-
Notifications
You must be signed in to change notification settings - Fork 0
/
blocks1.bas
96 lines (96 loc) · 2.05 KB
/
blocks1.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
100 ' Squares
110 ' Gilbert Francois Duivesteijn
120 '
130 BS=16: ' block size
132 BG=4*BS: ' block group size
134 OX=32: OY=0: ' offset
140 DIM CO(2)
150 CO(0)=14
160 CO(1)=6
170 CO(2)=1
180 COLOR 1,15,15: CLS
190 SCREEN 2
200 FOR K=0 TO 3
210 FOR L=0 TO 3
220 XB=OX+K*BG: YB=OY+L*BG: GOSUB 1000
230 NEXT L
240 NEXT K
260 GOTO 260
1000 '
1010 ' block group
1020 ' in: x, y
1030 '
1040 CU=CO(0)
1050 X=XB+0*BS: Y=YB+0*BS
1060 GOSUB 2200
1070 CU=CO(1)
1080 X=XB+1*BS: Y=YB+0*BS
1090 GOSUB 2200
1100 CU=CO(2) : CL=CO(1)
1110 X=XB+2*BS: Y=YB+0*BS
1120 GOSUB 2000
1130 CU=CO(2) : CL=CO(0)
1140 X=XB+3*BS: Y=YB+0*BS
1150 GOSUB 2100
1160 CU=CO(0) : CL=CO(2)
1170 X=XB+0*BS: Y=YB+1*BS
1180 GOSUB 2100
1190 CU=CO(1) : CL=CO(2)
1200 X=XB+1*BS: Y=YB+1*BS
1210 GOSUB 2000
1220 CU=CO(1) : CL=CO(0)
1230 X=XB+2*BS: Y=YB+1*BS
1240 GOSUB 2100
1250 CU=CO(0) : CL=CO(1)
1260 X=XB+3*BS: Y=YB+1*BS
1270 GOSUB 2000
1300 CU=CO(2) : CL=CO(1)
1310 X=XB+0*BS: Y=YB+2*BS
1320 GOSUB 2000
1330 CU=CO(2) : CL=CO(0)
1340 X=XB+1*BS: Y=YB+2*BS
1350 GOSUB 2100
1360 CU=CO(0) : CL=CO(0)
1370 X=XB+2*BS: Y=YB+2*BS
1380 GOSUB 2200
1390 CU=CO(1) : CL=CO(1)
1400 X=XB+3*BS: Y=YB+2*BS
1410 GOSUB 2200
1500 CU=CO(1) : CL=CO(0)
1510 X=XB+0*BS: Y=YB+3*BS
1520 GOSUB 2100
1530 CU=CO(0) : CL=CO(1)
1540 X=XB+1*BS: Y=YB+3*BS
1550 GOSUB 2000
1560 CU=CO(0) : CL=CO(2)
1570 X=XB+2*BS: Y=YB+3*BS
1580 GOSUB 2100
1590 CU=CO(1) : CL=CO(2)
1600 X=XB+3*BS: Y=YB+3*BS
1610 GOSUB 2000
1999 RETURN
2000 '
2010 ' block diag
2020 ' in: cu, cl, x, y, bs
2025 IF X>255-OX OR Y>191-OY GOTO 2070
2030 LINE(X,Y)-(X+BS-1,Y+BS-1),CU,BF
2040 FOR J=0 TO BS-1
2050 LINE(X,Y+J)-(X+J,Y+J),CL
2060 NEXT J
2070 RETURN
2100 '
2110 ' block diag-flipped
2120 ' in: cu, cl, x, y, bs
2125 IF X>255-OX OR Y>191-OY GOTO 2170
2130 LINE(X,Y)-(X+BS-1,Y+BS-1),CL,BF
2140 FOR J=0 TO BS-1
2150 LINE(X,Y+J)-(X+BS-1-J,Y+J),CU
2160 NEXT J
2170 RETURN
2200 '
2210 ' block solid
2220 ' in: cu, x, y, bs
2225 IF X>255-OX OR Y>191-OY GOTO 2240
2230 LINE(X,Y)-(X+BS-1,Y+BS-1),CU,BF
2240 RETURN