-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathArtistEnlarger.txt
199 lines (198 loc) · 15.8 KB
/
ArtistEnlarger.txt
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
109 GOTO 129 :: A$,B$,C$ :: A1,B1,D1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S :: CALL CHAR :: CALL CLEAR :: CALL COLOR :: CALL KEY :: CALL SCREEN :: CALL SOUND
110 CALL INIT :: CALL LOAD
119 DIM T(8),U(16),D$(32),E$(16,2),V(16,32),W(8,32):: !@P-
129 REM
139 M=1 :: N=1 :: ON ERROR 1089
149 CALL KEY(3,J,Q):: ON WARNING NEXT :: CALL CLEAR
159 CALL SCREEN(5):: FOR F=0 TO 14 :: CALL COLOR(F,16,1):: NEXT F
169 CALL CHAR(127,"3C42BDA1A1BD423E",126,"000FFFF"):: DISPLAY AT(4,6)ERASE ALL:"ARTIST ENLARGER" :: DISPLAY AT(5,6):"~~~~~~~~~~~~~~~~"
179 DISPLAY AT(9,3):"Manufactured by:": :" Asgard Software":" P.O. Box 10306":" Rockville, MD 20850"
189 DISPLAY AT(17,5):CHR$(127);" 1987 Howard Uman" :: DISPLAY AT(18,1):" ALL RIGHTS RESERVED" :: DISPLAY AT(20,1):" Concept: Tim Laswell"
199 DISPLAY AT(24,1)BEEP:" Press any key to begin."
209 CALL KEY(0,J,Q):: IF Q=0 THEN 209
219 DISPLAY AT(3,6)ERASE ALL:"ARTIST ENLARGER" :: DISPLAY AT(4,6):"~~~~~~~~~~~~~~~~"
229 DISPLAY AT(9,1)BEEP:"PRESS:" :: DISPLAY AT(12,5):"1 FOR INSTANCES" :: DISPLAY AT(13,5):"2 FOR FONTS" :: DISPLAY AT(14,5):"3 FOR CATALOG (_I _F)" :: DISPLAY AT(16,5):"0 TO EXIT"
239 CALL KEY(0,J,Q):: IF Q=0 THEN 239
249 IF J<48 OR J>51 THEN CALL SOUND(10,440,0):: GOTO 239
259 IF J=48 THEN CALL CLEAR :: CALL INIT :: CALL LOAD(-31961,51)
269 ON J-48 GOTO 279,859,1169
279 CALL CLEAR :: DISPLAY AT(1,1):" INSTANCE ENLARGEMENT":" ~~~~~~~~~~~~~~~~~~~~"
289 DISPLAY AT(7,1)BEEP:"INPUT FILE: DSK"&STR$(N)&". _I" :: ACCEPT AT(7,17)SIZE(-1)VALIDATE(DIGIT):A :: N=A
299 ACCEPT AT(7,19)SIZE(8)BEEP:A$ :: IF A$="" THEN 299
309 DISPLAY AT(9,1)BEEP:"OUTPUT FILE: DSK"&STR$(M)&". _I" :: ACCEPT AT(9,17)SIZE(-1)VALIDATE(DIGIT):B :: M=B
319 ACCEPT AT(9,19)SIZE(8)BEEP:B$ :: IF B$="" THEN 319
329 IF A=B AND A$=B$ THEN 289
339 DISPLAY AT(13,1)BEEP:"CHOOSE:": :" 1. FULL ENLARGEMENT":" 2. HORIZONTAL STRETCH":" 3. VERTICAL STRETCH"
349 DISPLAY AT(18,1):" 4. FULL REDUCTION":" 5. HORIZONTAL SQUEEZE":" 6. VERTICAL SQUEEZE"
359 CALL KEY(3,K,Q):: IF Q=0 THEN 359
369 IF K<49 OR K>54 THEN CALL SOUND(10,440,0):: GOTO 359
379 DISPLAY AT(15+K-49,2)SIZE(2):"->" :: OPEN #1:"DSK"&STR$(A)&"."&A$&"_I",INPUT :: OPEN #2:"DSK"&STR$(B)&"."&B$&"_I",OUTPUT :: INPUT #1:A,B :: IF K=50 THEN PRINT #2:STR$(A*2)&","&STR$(B):: GOSUB 509 :: GOTO 499
389 IF K=49 THEN PRINT #2:STR$(A*2)&","&STR$(B*2):: GOSUB 619 :: GOTO 499
399 IF K=51 THEN PRINT #2:STR$(A)&","&STR$(B*2):: GOSUB 779 :: GOTO 499
409 IF K<>52 THEN 449
419 IF B/2<>INT(B/2)THEN B1=B+1 ELSE B1=B
429 IF A/2<>INT(A/2)THEN A1=A+1 ELSE A1=A
439 PRINT #2:STR$(INT(A1/2))&","&STR$(INT(B1/2)):: GOSUB 1249 :: GOTO 499
449 IF K<>53 THEN 479
459 IF A/2<>INT(A/2)THEN A1=A+1 ELSE A1=A
469 PRINT #2:STR$(INT(A1/2))&","&STR$(B):: GOSUB 1259 :: GOTO 499
479 IF B/2<>INT(B/2)THEN B1=B+1 ELSE B1=B
489 PRINT #2:STR$(A)&","&STR$(INT(B1/2)):: GOSUB 1469
499 CLOSE #1 :: CLOSE #2 :: GOTO 219
509 IF A>16 THEN 829
519 FOR C=1 TO A*B :: INPUT #1:T(1),T(2),T(3),T(4),T(5),T(6),T(7),T(8):: FOR F=1 TO 16 :: U(F)=0 :: NEXT F :: FOR R=1 TO 8 :: IF T(R)>127 THEN U(R)=U(R)+192 :: T(R)=T(R)-128
529 NEXT R :: FOR R=1 TO 8 :: IF T(R)>63 THEN U(R)=U(R)+48 :: T(R)=T(R)-64
539 NEXT R :: FOR R=1 TO 8 :: IF T(R)>31 THEN U(R)=U(R)+12 :: T(R)=T(R)-32
549 NEXT R :: FOR R=1 TO 8 :: IF T(R)>15 THEN U(R)=U(R)+3 :: T(R)=T(R)-16
559 NEXT R :: FOR G=1 TO 8 :: IF T(G)>7 THEN U(G+8)=U(G+8)+192 :: T(G)=T(G)-8
569 NEXT G :: FOR G=1 TO 8 :: IF T(G)>3 THEN U(G+8)=U(G+8)+48 :: T(G)=T(G)-4
579 NEXT G :: FOR G=1 TO 8 :: IF T(G)>1 THEN U(G+8)=U(G+8)+12 :: T(G)=T(G)-2
589 NEXT G :: FOR G=1 TO 8 :: IF T(G)>0 THEN U(G+8)=U(G+8)+3 :: T(G)=T(G)-1
599 NEXT G :: PRINT #2:STR$(U(1))&","&STR$(U(2))&","&STR$(U(3))&","&STR$(U(4))&","&STR$(U(5))&","&STR$(U(6))&","&STR$(U(7))&","&STR$(U(8))
609 PRINT #2:STR$(U(9))&","&STR$(U(10))&","&STR$(U(11))&","&STR$(U(12))&","&STR$(U(13))&","&STR$(U(14))&","&STR$(U(15))&","&STR$(U(16)):: NEXT C :: RETURN
619 REM
629 IF B>12 THEN 829
639 IF A>16 THEN 829
649 FOR E=1 TO B :: FOR H=1 TO A :: INPUT #1:T(1),T(2),T(3),T(4),T(5),T(6),T(7),T(8):: FOR F=1 TO 16 :: U(F)=0 :: NEXT F :: FOR R=1 TO 8 :: IF T(R)>127 THEN U(R)=U(R)+192 :: T(R)=T(R)-128
659 NEXT R :: FOR R=1 TO 8 :: IF T(R)>63 THEN U(R)=U(R)+48 :: T(R)=T(R)-64
669 NEXT R :: FOR R=1 TO 8 :: IF T(R)>31 THEN U(R)=U(R)+12 :: T(R)=T(R)-32
679 NEXT R :: FOR R=1 TO 8 :: IF T(R)>15 THEN U(R)=U(R)+3 :: T(R)=T(R)-16
689 NEXT R :: FOR G=1 TO 8 :: IF T(G)>7 THEN U(G+8)=U(G+8)+192 :: T(G)=T(G)-8
699 NEXT G :: FOR G=1 TO 8 :: IF T(G)>3 THEN U(G+8)=U(G+8)+48 :: T(G)=T(G)-4
709 NEXT G :: FOR G=1 TO 8 :: IF T(G)>1 THEN U(G+8)=U(G+8)+12 :: T(G)=T(G)-2
719 NEXT G :: FOR G=1 TO 8 :: IF T(G)>0 THEN U(G+8)=U(G+8)+3 :: T(G)=T(G)-1
729 NEXT G :: PRINT #2:STR$(U(1))&","&STR$(U(1))&","&STR$(U(2))&","&STR$(U(2))&","&STR$(U(3))&","&STR$(U(3))&","&STR$(U(4))&","&STR$(U(4))
739 E$(H,1)=STR$(U(5))&","&STR$(U(5))&","&STR$(U(6))&","&STR$(U(6))&","&STR$(U(7))&","&STR$(U(7))&","&STR$(U(8))&","&STR$(U(8))
749 PRINT #2:STR$(U(9))&","&STR$(U(9))&","&STR$(U(10))&","&STR$(U(10))&","&STR$(U(11))&","&STR$(U(11))&","&STR$(U(12))&","&STR$(U(12))
759 E$(H,2)=STR$(U(13))&","&STR$(U(13))&","&STR$(U(14))&","&STR$(U(14))&","&STR$(U(15))&","&STR$(U(15))&","&STR$(U(16))&","&STR$(U(16)):: NEXT H
769 FOR H=1 TO A :: FOR I=1 TO 2 :: PRINT #2:E$(H,I):: NEXT I :: NEXT H :: NEXT E :: RETURN
779 REM
789 IF B>12 THEN 829
799 FOR E=1 TO B :: FOR F=1 TO A :: INPUT #1:T(1),T(2),T(3),T(4),T(5),T(6),T(7),T(8)
809 D$(F)=STR$(T(5))&","&STR$(T(5))&","&STR$(T(6))&","&STR$(T(6))&","&STR$(T(7))&","&STR$(T(7))&","&STR$(T(8))&","&STR$(T(8))
819 PRINT #2:STR$(T(1))&","&STR$(T(1))&","&STR$(T(2))&","&STR$(T(2))&","&STR$(T(3))&","&STR$(T(3))&","&STR$(T(4))&","&STR$(T(4)):: NEXT F :: FOR F=1 TO A :: PRINT #2:D$(F):: NEXT F :: NEXT E :: RETURN
829 DELETE "DSK"&STR$(M)&"."&B$ :: DISPLAY AT(24,1)BEEP:"FILE TOO LARGE. PRESS A KEY."
839 CALL KEY(0,J,Q):: IF Q=0 THEN 839
849 RETURN
859 CALL CLEAR :: DISPLAY AT(1,1):" FONT ENLARGEMENT":" ~~~~~~~~~~~~~~~~"
869 DISPLAY AT(7,1)BEEP:"INPUT FILE: DSK"&STR$(N)&". _F" :: ACCEPT AT(7,17)SIZE(-1)VALIDATE(DIGIT):A :: N=A
879 ACCEPT AT(7,19)SIZE(8)BEEP:A$ :: IF A$="" THEN 879
889 DISPLAY AT(9,1)BEEP:"OUTPUT FILE: DSK"&STR$(M)&". _F" :: ACCEPT AT(9,17)SIZE(-1)VALIDATE(DIGIT):B :: M=B
899 ACCEPT AT(9,19)SIZE(8)BEEP:B$ :: IF B$="" THEN 899
909 IF A=B AND A$=B$ THEN 869
919 DISPLAY AT(13,1)BEEP:"CHOOSE:": :" 1. FULL ENLARGEMENT":" 2. HORIZONTAL STRETCH":" 3. VERTICAL STRETCH"
929 DISPLAY AT(18,1):" 4. FULL REDUCTION":" 5. HORIZONTAL SQUEEZE":" 6. VERTICAL SQUEEZE"
939 CALL KEY(3,K,Q):: IF Q=0 THEN 939
949 IF K<49 OR K>54 THEN CALL SOUND(10,440,0):: GOTO 939
959 DISPLAY AT(15+K-49,2)SIZE(2):"->" :: OPEN #1:"DSK"&STR$(A)&"."&A$&"_F",INPUT :: OPEN #2:"DSK"&STR$(B)&"."&B$&"_F",OUTPUT
969 IF EOF(1)THEN 1079
979 S=1 :: INPUT #1:A$ :: PRINT #2:A$ :: DISPLAY AT(24,5):"NOW WORKING ON: ";A$ :: S=0 :: INPUT #1:A,B,D :: IF K=50 THEN PRINT #2:STR$(A*2)&","&STR$(B)&","&STR$(D*2):: GOSUB 509
989 IF K=49 THEN PRINT #2:STR$(A*2)&","&STR$(B*2)&","&STR$(D*2):: GOSUB 619
999 IF K=51 THEN PRINT #2:STR$(A)&","&STR$(B*2)&","&STR$(D):: GOSUB 779
1009 IF A/2<>INT(A/2)THEN A1=A+1 ELSE A1=A
1019 IF B/2<>INT(B/2)THEN B1=B+1 ELSE B1=B
1029 IF D/2<>INT(D/2)THEN D1=D+1 ELSE D1=D
1039 IF K=52 THEN PRINT #2:STR$(INT(A1/2))&","&STR$(INT(B1/2))&","&STR$(INT(D1/2)):: GOSUB 1249
1049 IF K=53 THEN PRINT #2:STR$(INT(A1/2))&","&STR$(B)&","&STR$(INT(D1/2)):: GOSUB 1259
1059 IF K=54 THEN PRINT #2:STR$(A)&","&STR$(INT(B1/2))&","&STR$(D):: GOSUB 1469
1069 GOTO 969
1079 CLOSE #1 :: CLOSE #2 :: GOTO 219
1089 IF S=1 THEN 1159
1099 CALL CLEAR :: CALL SCREEN(7):: DISPLAY AT(4,1):"ERROR: Check disk drive to make sure that the saving disk is not full."
1109 DISPLAY AT(9,1):" Make sure that the saving disk is not write protected."
1119 DISPLAY AT(13,1):" Check to make sure input file is on disk." :: DISPLAY AT(17,1):" Make sure you used legal filename(s)."
1129 DISPLAY AT(24,1)BEEP:"PRESS KEY TO RETURN TO MENU."
1139 CALL KEY(0,J,Q):: IF Q=0 THEN 1139
1149 ON ERROR 1089 :: CALL CLEAR :: CALL SCREEN(5):: GOTO 219
1159 CLOSE #1 :: CLOSE #2 :: ON ERROR 1089 :: GOTO 219
1169 REM
1179 CALL CLEAR :: DISPLAY AT(7,6):"CATALOG DRIVE: 1" :: ACCEPT AT(7,21)VALIDATE("123")BEEP SIZE(-1):A$ :: OPEN #1:"DSK"&A$&".",INPUT ,RELATIVE,INTERNAL :: INPUT #1:B$,H,H,J :: PRINT "HOLD ANY KEY TO PAUSE OR 'S'TO STOP.": :
1189 PRINT " DSK"&A$&" - DISKNAME=";B$:" AVAILABLE=";J;" USED=";H-J:"~~~~~~~~~~~~~~~~~~~~~~~~~~~~" :: PRINT :: FOR L=1 TO 127 :: INPUT #1:C$,A,H,J :: IF LEN(C$)=0 THEN 1239
1199 IF SEG$(C$,LEN(C$)-1,2)<>"_F" AND SEG$(C$,LEN(C$)-1,2)<>"_I" THEN 1229
1209 PRINT " ";C$,
1219 CALL KEY(3,J,Q):: IF J=83 THEN 1239 ELSE IF Q THEN 1219
1229 NEXT L
1239 CLOSE #1 :: PRINT :: PRINT :: DISPLAY AT(24,1)BEEP:" PRESS ANY KEY TO RETURN." :: GOTO 209
1249 GOTO 1699
1259 REM
1269 FOR O=1 TO B :: FOR P=1 TO A STEP 2 :: T(1),T(2),T(3),T(4),T(5),T(6),T(7),T(8)=0 :: INPUT #1:U(1),U(3),U(5),U(7),U(9),U(11),U(13),U(15)
1279 IF P=A THEN U(2),U(4),U(6),U(8),U(10),U(12),U(14),U(16)=0 :: GOTO 1299
1289 INPUT #1:U(2),U(4),U(6),U(8),U(10),U(12),U(14),U(16)
1299 FOR F=1 TO 15 STEP 2 :: IF U(F)>127 THEN U(F)=U(F)-128 :: T((F+1)/2)=T((F+1)/2)+128 :: IF U(F)>63 THEN U(F)=U(F)-64 :: GOTO 1319
1309 IF U(F)>63 THEN U(F)=U(F)-64 :: T((F+1)/2)=T((F+1)/2)+128
1319 IF U(F)>31 THEN U(F)=U(F)-32 :: T((F+1)/2)=T((F+1)/2)+64 :: IF U(F)>15 THEN U(F)=U(F)-16 :: GOTO 1339
1329 IF U(F)>15 THEN U(F)=U(F)-16 :: T((F+1)/2)=T((F+1)/2)+64
1339 IF U(F)>7 THEN U(F)=U(F)-8 :: T((F+1)/2)=T((F+1)/2)+32 :: IF U(F)>3 THEN U(F)=U(F)-4 :: GOTO 1359
1349 IF U(F)>3 THEN U(F)=U(F)-4 :: T((F+1)/2)=T((F+1)/2)+32
1359 IF U(F)>1 THEN U(F)=U(F)-2 :: T((F+1)/2)=T((F+1)/2)+16 :: IF U(F)THEN U(F)=0 :: GOTO 1379
1369 IF U(F)THEN U(F)=0 :: T((F+1)/2)=T((F+1)/2)+16
1379 G=F+1 :: IF U(G)>127 THEN U(G)=U(G)-128 :: T(G/2)=T(G/2)+8 :: IF U(G)>63 THEN U(G)=U(G)-64 :: GOTO 1399
1389 IF U(G)>63 THEN U(G)=U(G)-64 :: T(G/2)=T(G/2)+8
1399 IF U(G)>31 THEN U(G)=U(G)-32 :: T(G/2)=T(G/2)+4 :: IF U(G)>15 THEN U(G)=U(G)-16 :: GOTO 1419
1409 IF U(G)>15 THEN U(G)=U(G)-16 :: T(G/2)=T(G/2)+4
1419 IF U(G)>7 THEN U(G)=U(G)-8 :: T(G/2)=T(G/2)+2 :: IF U(G)>3 THEN U(G)=U(G)-4 :: GOTO 1439
1429 IF U(G)>3 THEN U(G)=U(G)-4 :: T(G/2)=T(G/2)+2
1439 IF U(G)>1 THEN U(G)=U(G)-2 :: T(G/2)=T(G/2)+1 :: IF U(G)THEN U(G)=0 :: GOTO 1459
1449 IF U(G)THEN U(G)=0 :: T(G/2)=T(G/2)+1
1459 NEXT F :: PRINT #2:STR$(T(1))&","&STR$(T(2))&","&STR$(T(3))&","&STR$(T(4))&","&STR$(T(5))&","&STR$(T(6))&","&STR$(T(7))&","&STR$(T(8)):: NEXT P :: NEXT O :: RETURN
1469 REM
1479 FOR O=1 TO B STEP 2 :: FOR P=1 TO A :: INPUT #1:V(1,P),V(2,P),V(3,P),V(4,P),V(5,P),V(6,P),V(7,P),V(8,P):: NEXT P :: IF O<>B THEN 1499
1489 FOR P=1 TO A :: V(9,P),V(10,P),V(11,P),V(12,P),V(13,P),V(14,P),V(15,P),V(16,P)=0 :: NEXT P :: GOTO 1509
1499 FOR P=1 TO A :: INPUT #1:V(9,P),V(10,P),V(11,P),V(12,P),V(13,P),V(14,P),V(15,P),V(16,P):: NEXT P
1509 FOR P=1 TO A :: T(1),T(2),T(3),T(4),T(5),T(6),T(7),T(8)=0 :: FOR F=1 TO 15 STEP 2
1519 IF V(F,P)>127 THEN V(F,P)=V(F,P)-128 :: T((F+1)/2)=T((F+1)/2)+128 :: IF V(F+1,P)>127 THEN V(F+1,P)=V(F+1,P)-128
1529 IF V(F+1,P)>127 THEN V(F+1,P)=V(F+1,P)-128 :: T((F+1)/2)=T((F+1)/2)+128
1539 IF V(F,P)>63 THEN V(F,P)=V(F,P)-64 :: T((F+1)/2)=T((F+1)/2)+64 :: IF V(F+1,P)>63 THEN V(F+1,P)=V(F+1,P)-64
1549 IF V(F+1,P)>63 THEN V(F+1,P)=V(F+1,P)-64 :: T((F+1)/2)=T((F+1)/2)+64
1559 IF V(F,P)>31 THEN V(F,P)=V(F,P)-32 :: T((F+1)/2)=T((F+1)/2)+32 :: IF V(F+1,P)>31 THEN V(F+1,P)=V(F+1,P)-32
1569 IF V(F+1,P)>31 THEN V(F+1,P)=V(F+1,P)-32 :: T((F+1)/2)=T((F+1)/2)+32
1579 IF V(F,P)>15 THEN V(F,P)=V(F,P)-16 :: T((F+1)/2)=T((F+1)/2)+16 :: IF V(F+1,P)>15 THEN V(F+1,P)=V(F+1,P)-16
1589 IF V(F+1,P)>15 THEN V(F+1,P)=V(F+1,P)-16 :: T((F+1)/2)=T((F+1)/2)+16
1599 IF V(F,P)>7 THEN V(F,P)=V(F,P)-8 :: T((F+1)/2)=T((F+1)/2)+8 :: IF V(F+1,P)>7 THEN V(F+1,P)=V(F+1,P)-8
1609 IF V(F+1,P)>7 THEN V(F+1,P)=V(F+1,P)-8 :: T((F+1)/2)=T((F+1)/2)+8
1619 IF V(F,P)>3 THEN V(F,P)=V(F,P)-4 :: T((F+1)/2)=T((F+1)/2)+4 :: IF V(F+1,P)>3 THEN V(F+1,P)=V(F+1,P)-4
1629 IF V(F+1,P)>3 THEN V(F+1,P)=V(F+1,P)-4 :: T((F+1)/2)=T((F+1)/2)+4
1639 IF V(F,P)>1 THEN V(F,P)=V(F,P)-2 :: T((F+1)/2)=T((F+1)/2)+2 :: IF V(F+1,P)>1 THEN V(F+1,P)=V(F+1,P)-2
1649 IF V(F+1,P)>1 THEN V(F+1,P)=V(F+1,P)-2 :: T((F+1)/2)=T((F+1)/2)+2
1659 IF V(F,P)THEN V(F,P)=0 :: T((F+1)/2)=T((F+1)/2)+1 :: IF V(F+1,P)THEN V(F+1,P)=0
1669 IF V(F+1,P)THEN T((F+1)/2)=T((F+1)/2)+1 :: V(F+1,P)=0
1679 NEXT F
1689 PRINT #2:STR$(T(1))&","&STR$(T(2))&","&STR$(T(3))&","&STR$(T(4))&","&STR$(T(5))&","&STR$(T(6))&","&STR$(T(7))&","&STR$(T(8)):: NEXT P :: NEXT O :: RETURN
1699 REM
1709 FOR O=1 TO B STEP 2 :: FOR P=1 TO A :: INPUT #1:V(1,P),V(2,P),V(3,P),V(4,P),V(5,P),V(6,P),V(7,P),V(8,P):: NEXT P :: IF O<>B THEN 1729
1719 FOR P=1 TO A :: V(9,P),V(10,P),V(11,P),V(12,P),V(13,P),V(14,P),V(15,P),V(16,P)=0 :: NEXT P :: GOTO 1739
1729 FOR P=1 TO A :: INPUT #1:V(9,P),V(10,P),V(11,P),V(12,P),V(13,P),V(14,P),V(15,P),V(16,P):: NEXT P
1739 FOR P=1 TO A :: T(1),T(2),T(3),T(4),T(5),T(6),T(7),T(8)=0 :: FOR F=1 TO 15 STEP 2
1749 IF V(F,P)>127 THEN V(F,P)=V(F,P)-128 :: T((F+1)/2)=T((F+1)/2)+128 :: IF V(F+1,P)>127 THEN V(F+1,P)=V(F+1,P)-128
1759 IF V(F+1,P)>127 THEN V(F+1,P)=V(F+1,P)-128 :: T((F+1)/2)=T((F+1)/2)+128
1769 IF V(F,P)>63 THEN V(F,P)=V(F,P)-64 :: T((F+1)/2)=T((F+1)/2)+64 :: IF V(F+1,P)>63 THEN V(F+1,P)=V(F+1,P)-64
1779 IF V(F+1,P)>63 THEN V(F+1,P)=V(F+1,P)-64 :: T((F+1)/2)=T((F+1)/2)+64
1789 IF V(F,P)>31 THEN V(F,P)=V(F,P)-32 :: T((F+1)/2)=T((F+1)/2)+32 :: IF V(F+1,P)>31 THEN V(F+1,P)=V(F+1,P)-32
1799 IF V(F+1,P)>31 THEN V(F+1,P)=V(F+1,P)-32 :: T((F+1)/2)=T((F+1)/2)+32
1809 IF V(F,P)>15 THEN V(F,P)=V(F,P)-16 :: T((F+1)/2)=T((F+1)/2)+16 :: IF V(F+1,P)>15 THEN V(F+1,P)=V(F+1,P)-16
1819 IF V(F+1,P)>15 THEN V(F+1,P)=V(F+1,P)-16 :: T((F+1)/2)=T((F+1)/2)+16
1829 IF V(F,P)>7 THEN V(F,P)=V(F,P)-8 :: T((F+1)/2)=T((F+1)/2)+8 :: IF V(F+1,P)>7 THEN V(F+1,P)=V(F+1,P)-8
1839 IF V(F+1,P)>7 THEN V(F+1,P)=V(F+1,P)-8 :: T((F+1)/2)=T((F+1)/2)+8
1849 IF V(F,P)>3 THEN V(F,P)=V(F,P)-4 :: T((F+1)/2)=T((F+1)/2)+4 :: IF V(F+1,P)>3 THEN V(F+1,P)=V(F+1,P)-4
1859 IF V(F+1,P)>3 THEN V(F+1,P)=V(F+1,P)-4 :: T((F+1)/2)=T((F+1)/2)+4
1869 IF V(F,P)>1 THEN V(F,P)=V(F,P)-2 :: T((F+1)/2)=T((F+1)/2)+2 :: IF V(F+1,P)>1 THEN V(F+1,P)=V(F+1,P)-2
1879 IF V(F+1,P)>1 THEN V(F+1,P)=V(F+1,P)-2 :: T((F+1)/2)=T((F+1)/2)+2
1889 T((F+1)/2)=T((F+1)/2)+INT((V(F,P)+V(F+1,P))/2):: NEXT F :: FOR F=1 TO 8 :: W(F,P)=T(F):: NEXT F :: NEXT P
1899 FOR P=1 TO A STEP 2 :: T(1),T(2),T(3),T(4),T(5),T(6),T(7),T(8)=0 :: FOR F=1 TO 8 :: IF P=A THEN W(F,P+1)=0
1909 IF W(F,P)>127 THEN W(F,P)=W(F,P)-128 :: T(F)=T(F)+128 :: IF W(F,P)>63 THEN W(F,P)=W(F,P)-64 :: GOTO 1929
1919 IF W(F,P)>63 THEN W(F,P)=W(F,P)-64 :: T(F)=T(F)+128
1929 IF W(F,P)>31 THEN W(F,P)=W(F,P)-32 :: T(F)=T(F)+64 :: IF W(F,P)>15 THEN W(F,P)=W(F,P)-16 :: GOTO 1949
1939 IF W(F,P)>15 THEN W(F,P)=W(F,P)-16 :: T(F)=T(F)+64
1949 IF W(F,P)>7 THEN W(F,P)=W(F,P)-8 :: T(F)=T(F)+32 :: IF W(F,P)>3 THEN W(F,P)=W(F,P)-4 :: GOTO 1969
1959 IF W(F,P)>3 THEN W(F,P)=W(F,P)-4 :: T(F)=T(F)+32
1969 IF W(F,P)>1 THEN W(F,P)=W(F,P)-2 :: T(F)=T(F)+16 :: IF W(F,P)>0 THEN W(F,P)=W(F,P)-1 :: GOTO 1989
1979 IF W(F,P)>0 THEN W(F,P)=W(F,P)-1 :: T(F)=T(F)+16
1989 IF W(F,P+1)>127 THEN W(F,P+1)=W(F,P+1)-128 :: T(F)=T(F)+8 :: IF W(F,P+1)>63 THEN W(F,P+1)=W(F,P+1)-64 :: GOTO 2009
1999 IF W(F,P+1)>63 THEN W(F,P+1)=W(F,P+1)-64 :: T(F)=T(F)+8
2009 IF W(F,P+1)>31 THEN W(F,P+1)=W(F,P+1)-32 :: T(F)=T(F)+4 :: IF W(F,P+1)>15 THEN W(F,P+1)=W(F,P+1)-16 :: GOTO 2029
2019 IF W(F,P+1)>15 THEN W(F,P+1)=W(F,P+1)-16 :: T(F)=T(F)+4
2029 IF W(F,P+1)>7 THEN W(F,P+1)=W(F,P+1)-8 :: T(F)=T(F)+2 :: IF W(F,P+1)>3 THEN W(F,P+1)=W(F,P+1)-4 :: GOTO 2049
2039 IF W(F,P+1)>3 THEN W(F,P+1)=W(F,P+1)-4 :: T(F)=T(F)+2
2049 IF W(F,P+1)>1 THEN W(F,P+1)=W(F,P+1)-2 :: T(F)=T(F)+1 :: IF W(F,P+1)>0 THEN W(F,P+1)=W(F,P+1)-1 :: GOTO 2069
2059 IF W(F,P+1)>0 THEN W(F,P+1)=W(F,P+1)-1 :: T(F)=T(F)+1
2069 NEXT F :: PRINT #2:STR$(T(1))&","&STR$(T(2))&","&STR$(T(3))&","&STR$(T(4))&","&STR$(T(5))&","&STR$(T(6))&","&STR$(T(7))&","&STR$(T(8)):: NEXT P :: NEXT O :: RETURN