8-Bit Software Online Conversion
:2.S.Tetris - Listing
10 REM TETRIS
20 PRINTRND(-TIME):REM Randomise
30 VDU26:CLS:VDU23;8202;0;0;0;
40 *FX4 1
50 MOVE 0,0:DRAW 0,1000:DRAW 1200,100
0
60 DRAW 1200,0:DRAW 0,0
70 MOVE 8,8:DRAW 8,992:DRAW 1192,992:
DRAW 1192,8:DRAW 8,8
80 MOVE 8,12:DRAW 1192,12
90 MOVE 8,16:DRAW 1192,16:MOVE 8,20:D
RAW 1192,20
100 MOVE430,8
110 DRAW430,990
120 MOVE 438,8
130 DRAW 438,990
140 PRINTTAB(2,0);"¼ ¾"
150 VDU23,150,255,128,191,160,225,1,1,
1
160 VDU23,151,255,1,253,5,199,64,64,64
170 VDU23,152,1,1,1,1,1,7,4,7
180 VDU23,153,64,64,64,64,64,112,16,24
0
190 PRINTTAB(19,2)CHR$150;CHR$151;TAB(
19,3)CHR$152;CHR$153;TAB(23,2)CHR$150;CH
R$151;TAB(23,3)CHR$152;CHR$153
200 VDU23,150,63,32,57,9,9,9,9,9
210 VDU23,151,254,2,250,14,0,0,0,120
220 VDU23,152,9,9,9,9,9,57,32,63
230 VDU23,153,72,120,0,0,14,250,2,254
240 PRINTTAB(21,2)CHR$150;CHR$151;TAB(
21,3)CHR$152;CHR$153
250 VDU23,150,63,32,59,10,10,10,11,8
260 VDU23,151,252,4,228,36,76,152,48,1
6
270 VDU23,152,9,9,9,9,9,57,32,63
280 VDU23,153,216,76,102,51,25,12,7,1
290 PRINTTAB(25,2)CHR$150;CHR$151;TAB(
25,3)CHR$152;CHR$153
300 VDU23,150,63,32,57,9,9,9,9,9
310 VDU23,151,207,72,201,9,4,2,1,0
320 VDU23,152,9,9,9,9,137,249,0,255
330 VDU23,153,0,0,0,0,14,203,72,207
340 PRINTTAB(27,2)CHR$150;CHR$151;TAB(
27,3)CHR$152;CHR$153
350 VDU23,150,254,2,250,14,128,64,32,1
44
360 VDU23,151,72,36,18,10,10,250,2,254
370 PRINTTAB(29,2)CHR$150;TAB(29,3)CHR
$151
380 S%=0:L%=0:V%=1:F%=36
390 PRINTTAB(22,7)"SCORE"
400 MOVE 665,748
410 DRAW 900,748
420 DRAW 900,700
430 DRAW 665,700
440 DRAW 665,748
450 PRINTTAB(22,12)"LINES"
460 MOVE 665,588
470 DRAW 900,588
480 DRAW 900,540
490 DRAW 665,540
500 DRAW 665,588
510 PRINTTAB(22,17)"LEVEL"
520 MOVE 755,425:DRAW 840,425
530 DRAW 840,380:DRAW 755,380:DRAW 755
,425
540 PRINTTAB(20,22)"NEXT SHAPE"
550 MOVE 670,270
560 DRAW 900,270
570 DRAW 900,120
580 DRAW 670,120
590 DRAW 670,270
600 PROCAssemble`Mcode
610 ?&CF1=RND(6+V%):REM Choose next sh
ape type
620 ?&CE9=RND(4):REM RND Rotate Number
630 REPEAT
640 ?&CF0=?&CF1:REM Current shape=Next
Shape
650 ?&CB5=RND(3):REM Choose colour
660 ?&CB6=251+RND(4):REM Choose Block
Type
670 X%=0:Y%=?&CF0:CALL Download:REM X%
=0 Means Current Shape, @ &0B00; Y%=Shap
e type
680 ?&CD2=0:FORI%=1TO?&CE9:CALLRotate:
NEXT
690 ?&CF1=RND(6+V%):REM Choose next sh
ape type
700 ?&CE9=RND(4)
710 X%=16:Y%=?&CF1:CALL Download:REM X
%=16 Means Next Shape, @ &0B10; Y%=Shape
type
720 PROCDisplay`Next`shape
730 H%=3:O%=1:REM Set X & Y
740 ?&CE8=0:REM Zero Contents Constant
750 IFNOTFNFit2 PROCDisplay`current`sh
ape2:CLEAR:GOTO3130
760 PROCPlace`shape
770 PROCDisplay`current`shape
780 FORG%=1TO2
790 REPEAT
800 COLOUR3
810 PRINTTAB(21,9)STRING$(7-LENSTR$(S%
),"0");S%;
820 PRINTTAB(21,14)STRING$(7-LENSTR$(L
%),"0");L%;
830 PRINTTAB(24,19)STRING$(2-LENSTR$(V
%),"0");V%;
840 TIME=0:B%=0
844REM ADDED BY CJR
845*FX 21
850 REPEAT
860 PROCKey`check
870 UNTILTIME>F% ORB%
880 IFFNFit(0,1) ?&78=0:CALLMove:REM 0
=Down
890 PROCKey`check
900 UNTIL NOTFNFit(0,1)
910 IFB% G%=2
920 NEXT
930 S%=S%+30
940 E%=0:FORJ%=O%TOO%+3:FORK%=H%TOH%+3
950 IF?FNScreen`array=1 ?FNScreen`arra
y=2
960 E%=E%+1:NEXT,
970 FORJ%=O%TOO%+3
980 IFJ%>30 J%=O%+3:GOTO1030
990 D%=0:FORK%=1TO12
1000 IF?FNScreen`array=2 D%=D%+1
1010 NEXT
1020 IFD%>11 PROCDelete`line(J%)
1030 NEXT
1040 UNTIL0
1050 DEFPROCPlace`shape
1060 E%=0:FORJ%=O%TOO%+3:FORK%=H%TOH%+3
1070 ?FNScreen`array=?(&B00+E%)
1080 E%=E%+1:NEXT,
1090 ENDPROC
1100 DEFFNScreen`array
1110 LOCAL X%,Y%
1120 X%=K%:Y%=J%:CALLGetValue
1130 =?&71*256+?&70
1140 DEFFNScreen`array2
1150 IF(K%<1 ORK%>12 ORJ%>30):=&CE8 ELS
E:=&B4A+((J%-1)*12)+K%
1160 DEFPROCKey`check
1165REM *FX21 ADDED BY CJR
1170 A$=INKEY$(0):*FX21
1180 IFA$=" " ANDFNFit(-1,0) ?&78=1:CAL
LMove
1190 IFA$=" " ANDFNFit(1,0) ?&78=2:CALL
Move
1200 IFA$="X" ?&CF4=1:CALLDo`Rotate
1210 IFA$="Z" ?&CF4=3:CALLDo`Rotate
1220 IFA$=CHR$27 CLEAR:GOTO3130
1230 IFA$=" " PROCDrop:B%=-1
1240 ENDPROC
1250 DEFFNFit2
1260 Z%=-1
1270 E%=0:FORJ%=O%TOO%+3:FORK%=H%TOH%+3
1280 IF?(&B00+E%)=1 AND?FNScreen`array>
0 Z%=0
1290 IF?(&B00+E%)=1 AND(J%>30 ORK%>12)
Z%=0
1300 E%=E%+1:NEXT,
1310 =Z%
1320 DEFPROCMove(Q%)
1330 CALLBlank`Shape
1340 IFQ%>0 GOTO1400
1350 FORJ%=O%+3TOO% STEP-1:FORK%=H%TOH%
+3
1360 IF?FNScreen`array=1 J%=J%+1:?FNScr
een`array=1:J%=J%-1:?FNScreen`array=0
1370 NEXT,
1380 O%=O%+1
1390 GOTO1510
1400 IFQ%>1 GOTO1470
1410 FORK%=H%TOH%+3:FORJ%=O%TOO%+3
1420 IF?FNScreen`array=1 ANDK%-1<1 VDU7
:PRINT"ERROR2!":END
1430 IF?FNScreen`array=1 K%=K%-1:?FNScr
een`array=1:K%=K%+1:?FNScreen`array=0
1440 NEXT,
1450 H%=H%-1
1460 GOTO1510
1470 FORK%=H%+3TOH% STEP-1:FORJ%=O%TOO%
+3
1480 IF?FNScreen`array=1 K%=K%+1:?FNScr
een`array=1:K%=K%-1:?FNScreen`array=0
1490 NEXT,
1500 H%=H%+1
1510 PROCDisplay`current`shape
1520 ENDPROC
1530 DEFPROCDisplay`Next`shape
1540 COLOUR3:E%=0:FORN%=24TO27:FORM%=22
TO25
1550 IF?(&B10+E%)=1 PRINTTAB(M%,N%)CHR$
252 ELSEIF?(&B10+E%)=0 PRINTTAB(M%,N%)"
"
1560 E%=E%+1
1570 NEXT,
1580 ENDPROC
1590 DEFPROCDisplay`current`shape2
1600 COLOUR?&CB5:E%=0:FORN%=O%TOO%+3:FO
RM%=H%TOH%+3
1610 IF?(&B00+E%)=1 PRINTTAB(M%,N%)CHR$
?&CB6
1620 E%=E%+1
1630 NEXT,
1640 ENDPROC
1650 DEFPROCDisplay`current`shape
1660 CALLDisplay`Curr`Shape
1670 ENDPROC
1680 DEFPROCOrig`Display`current`shape
1690 COLOUR?&CB5:FORJ%=O%TOO%+3:FORK%=H
%TOH%+3
1700 IF?FNScreen`array=1 PRINTTAB(K%,J%
)CHR$?&CB6
1710 NEXT,
1720 ENDPROC
1730 DEFFNFit(R%,T%)
1740 ?&76=R%:?&77=T%
1750 CALL Fit:=?&CE6=255
1760 DEFFNFit8(R%,T%)
1770 Z%=-1
1780 FORJ%=O%TOO%+3:FORK%=H%TOH%+3
1790 Y%=J%:X%=K%:IF?FNScreen`array=1 J%
=J%+T%:K%=K%+R%:IF?FNScreen`array=2 Z%=0
1800 J%=Y%:K%=X%
1810 IF?FNScreen`array=1 AND((J%+T%)>30
OR(K%+R%)>12 OR(K%+R%)<1) Z%=0
1820 NEXT,
1830 =Z%
1840 DEFPROCDrop
1850 REPEAT
1860 IFFNFit(0,1) ?&78=0:CALLMove
1870 UNTILNOTFNFit(0,1)
1880 ENDPROC
1890 DEFPROCDelete`line(U%)
1900 LOCAL J%,K%
1910 COLOUR3:PRINTTAB(1,U%)STRING$(12,C
HR$255)
1920 FORJ%=U%-1 TO1 STEP-1:FORK%=12TO1
STEP-1
1930 W%=FNScreen`array:?(W%+12)=?W%
1940 NEXT,
1950 IFU%<15 FORW%=1TO130*(15-(U%-1)):N
EXT
1960 SOUND1,-15,46,4
1970 J%=1:FORK%=1TO12:?FNScreen`array=0
:NEXT
1980 PRINTTAB(1,U%)STRING$(12," ")
1990 VDU28,1,U%,12,1
2000 PRINTTAB(0,0);CHR$8;
2010 VDU26
2020 L%=L%+1:IFL%MOD13=0 V%=V%+1:F%=F%-
3:S%=S%+180:IF(V%+6)>?&7D V%=(?&7D-6)
2030 ENDPROC
2040 DEFPROCRotate(?&CF4)
2050 LOCALI%
2060 E%=0:FORJ%=O%TOO%+3:FORK%=H%TOH%+3
2070 ?(&B00+E%)=?FNScreen`array
2080 IF?(&B00+E%)=1 PRINTTAB(K%,J%)" "
2090 E%=E%+1:NEXT,
2100 ?&CD2=0:FORI%=1TO?&CF4:CALLRotate:
NEXT
2110 Z%=-1:E%=0:FORJ%=O%TOO%+3:FORK%=H%
TOH%+3
2120 IF?(&B00+E%)=1 AND(J%>30 OR(K%MOD2
56)>12OR(K%MOD256)<1) Z%=0:IFJ%>30 GOTO2
170
2130 E%=E%+1:NEXT,:IFNOTZ% GOTO2170
2140 E%=0:FORJ%=O%TOO%+3:FORK%=H%TOH%+3
2150 ?FNScreen`array=?(&B00+E%)
2160 E%=E%+1:NEXT,
2170 PROCDisplay`current`shape
2180 ENDPROC
2190 DEFPROCAssemble`Mcode
2200 FORPASS%=0TO2STEP2
2210 P%=&900:[OPT PASS%
2220 .Rotate:LDX#15:.Loop1:STZ&CC0,X
2230 DEX:BPL Loop1:LDA&CD2:CLC:ADC#15
2240 STA&CD3:TAX:.Loop2
2250 LDA&B00,X:CMP#2:BEQ Store:.T1
2260 DEX:BPL Loop2
2270 BRA Cont:.Store:STA&CC0,X
2280 BRA T1:.Cont:LDA#3:STA&CD0
2290 LDX#0:.Next4:LDY&CD0:.NextPiece
2300 LDA&B00,X:CMP#1:BEQ Rotate`it
2310 BRA AdvanceX
2320 .Rotate`it:PHA:LDA&CC0,Y
2330 CMP#2:BEQSpecialExit:PLA:STA&CC0,Y
2340 .AdvanceX:INX:INY:INY:INY:INY
2350 CPX#16:BCS CopyBack:CPY#17:BCS Dec
CD0
2360 BRA NextPiece:.DecCD0:DEC &CD0:BPL
Next4
2370 .CopyBack:LDY#15:LDX&CD3:.Loop5:LD
A&CC0,Y
2380 STA&B00,X:DEX:DEY:BPLLoop5
2390 BRA Exit
2400 .SpecialExit:PLA:.Exit:RTS
2410 .Download:LDA#7:STA&CD8
2420 DEY:TYA:ASL A:TAY
2430 LDA&FA2,Y:.Loop6:ASL A:PHA
2440 BCC ST0:BCS ST1:.Cont1
2450 DEC&CD8:LDA&CD8:BMI Over1
2460 PLA:BRALoop6
2470 .Over1:PLA:LDA#15:STA&CD8:INY:LDA&
FA2,Y
2480 .Loop7:ASL A:PHA
2490 BCC S0:BCS S1:.Cont2
2500 DEC&CD8:LDA&CD8:CMP#7:BEQ Over
2510 PLA:BRALoop7
2520 .Over:PLA:RTS
2530 .ST0:TXA:CLC:ADC&CD8:PHX:TAX
2540 STZ&B00,X:PLX:BRACont1
2550 .ST1:TXA:CLC:ADC&CD8:PHX:TAX
2560 LDA#1:STA&B00,X:PLX:BRACont1
2570 .S0:TXA:CLC:ADC&CD8:PHX:TAX
2580 STZ&B00,X:PLX:BRACont2
2590 .S1:TXA:CLC:ADC&CD8:PHX:TAX
2600 LDA#1:STA&B00,X:PLX:BRACont2
2610 .GetValue:CPX#1:BCC StoreZero:CPX#
13:BCS StoreZero:CPY#31:BCS StoreZero
2620 LDA#&B:STA&71:LDA#&4A:STA&70:STZ&7
3:DEY:STY&72
2630 PHX:LDX#11:.CalcLoop:TYA:CLC
2640 ADC&72:STA&72:BCC NoOverflow:INC&7
3
2650 .NoOverflow:DEX:BNE CalcLoop
2660 PLX:TXA:CLC:ADC&72:STA&72:BCC NoOv
erflow2:INC&73
2670 .NoOverflow2:CLC:LDA&72:ADC&70:STA
&70:LDA&73:ADC&71:STA&71
2680 RTS:.StoreZero:LDA#&C:STA&71:LDA#&
E8:STA&70:RTS
2690 .Fit:LDA#255:STA&CE6
2700 LDY&43C:STZ&75:.Loop1F:LDX&420:STZ
&74
2710 .Loop2F:PHY:PHX:JSR GetValue:LDA(&
70):CMP#1:BEQ Testif2
2720 PLX:PLY:BRA Cont`F1
2730 .Testif2:PLA:STA&78:CLC:ADC&76:TAX
:PLA:STA&79:CLC:ADC&77:TAY:PHY:PHX
2740 JSR GetValue:LDA(&70):CMP#2:BEQ No
Good2:PLX:PLY:CPY#31:BCS NoGood:CPX#13:B
CS NoGood:CPX#1:BCC NoGood
2750 LDX&78:LDY&79
2760 .Cont`F1:INX:INC &74:LDA&74:CMP#4:
BCC Loop2F
2770 INY:INC&75:LDA&75:CMP#4:BCC Loop1F
2780 RTS:.NoGood:STZ&CE6:RTS:.NoGood2:P
LX:PLY:BRA NoGood
2790 .Display`Curr`Shape:LDA#17:JSR&FFE
E:LDA&CB5:JSR&FFEE
2800 LDY&43C:STZ&77:.Loop1DCS:LDX&420:S
TZ&76
2810 .Loop2DCS:PHX:PHY:JSR GetValue:PLY
:PLX:LDA(&70):CMP#1:BNE ContDCS
2820 LDA#31:JSR&FFEE:TXA:JSR&FFEE:TYA:J
SR&FFEE:LDA&CB6:JSR&FFEE
2830 .ContDCS:INX:INC&76:LDA&76:CMP#4:B
CC Loop2DCS
2840 INY:INC&77:LDA&77:CMP#4:BCC Loop1D
CS:RTS
2850 .Blank`Shape
2860 LDA&CB6:PHA:LDA#32:STA&CB6:JSR Dis
play`Curr`Shape:PLA:STA&CB6:RTS
2870 .Move:JSR Blank`Shape:LDA&78:BNE C
ont1`Move:JMP Move0:.Cont1`Move:CMP#1:BN
E Cont2`Move:JMP Move1:.Cont2`Move:CMP#2
:BNE Err`Exit:JMP Move2:.Err`Exit:RTS
2880 ]:P%=&E00:[OPT PASS%
2890 .Move0:LDY&43C:INY:INY:INY:STZ&75:
.Loop1M0:LDX&420:STZ&74:.Loop2M0
2900 PHY:PHX:JSR GetValue:PLX:PLY:LDA(&
70):CMP#1:BNE Cont`M0
2910 INY:PHY:PHX:JSR GetValue:PLX:PLY:L
DA#1:STA(&70):DEY:PHY:PHX:JSR GetValue:P
LX:PLY:LDA#0:STA(&70)
2920 .Cont`M0:INX:INC&74:LDA&74:CMP#4:B
CC Loop2M0
2930 DEY:INC&75:LDA&75:CMP#4:BCC Loop1M
0:INC&43C:JMP Disp`Exit
2940 .Move1:LDX&420:STZ&74:.Loop1M1:LDY
&43C:STZ&75:.Loop2M1
2950 PHY:PHX:JSR GetValue:PLX:PLY:LDA(&
70):CMP#1:BNE Cont`M1
2960 DEX:PHY:PHX:JSR GetValue:PLX:PLY:L
DA#1:STA(&70):INX:PHY:PHX:JSR GetValue:P
LX:PLY:LDA#0:STA(&70)
2970 .Cont`M1:INY:INC&75:LDA&75:CMP#4:B
CC Loop2M1
2980 INX:INC&74:LDA&74:CMP#4:BCC Loop1M
1:DEC&420:BRA Disp`Exit
2990 .Move2:LDX&420:INX:INX:INX:STZ&74:
.Loop1M2:LDY&43C:STZ&75:.Loop2M2
3000 PHY:PHX:JSR GetValue:PLX:PLY:LDA(&
70):CMP#1:BNE Cont`M2
3010 INX:PHY:PHX:JSR GetValue:PLX:PLY:L
DA#1:STA(&70):DEX:PHY:PHX:JSR GetValue:P
LX:PLY:LDA#0:STA(&70)
3020 .Cont`M2:INY:INC&75:LDA&75:CMP#4:B
CC Loop2M2
3030 DEX:INC&74:LDA&74:CMP#4:BCC Loop1M
2:INC&420
3040 .Disp`Exit:JSR Display`Curr`Shape:
RTS
3041 .Do`Rotate:STZ&78:LDY&43C:STZ&75:.
Loop1Rot:LDX&420:STZ&74:.Loop2Rot:PHY:PH
X:JSR GetValue:LDA(&70):LDY&78:STA&B00,Y
:PLX:PLY:CMP#1:BNE Cont1Rot
3042 LDA#31:JSR&FFEE:TXA:JSR&FFEE:TYA:J
SR&FFEE:LDA#32:JSR&FFEE:.Cont1Rot:INC&78
:INX:INC&74:LDA&74:CMP#4:BCC Loop2Rot:IN
Y:INC&75:LDA&75:CMP#4:BCC Loop1Rot
3043 STZ&CD2:LDX#0:.Loop3Rot:PHX:JSR Ro
tate:PLX:INX:CPX&CF4:BCC Loop3Rot
3044 STZ&78:LDY&43C:STZ&75:.Loop4Rot:LD
X&420:STZ&74:.Loop5Rot:PHY:LDY&78:LDA&B0
0,Y:PLY:CMP#1:BNE Cont2Rot:CPY#31:BCC Co
nt3Rot:JMP Display`Shape`Exit:.Cont3Rot:
CPX#13:BCC Cont4Rot:JMP Display`Shape`Ex
it:.Cont4Rot:CPX#1:BCS Cont2Rot
3045 JMP Display`Shape`Exit:.Cont2Rot:I
NC&78:INX:INC&74:LDA&74:CMP#4:BCC Loop5R
ot:INY:INC&75:LDA&75:CMP#4:BCC Loop4Rot
3046 STZ&78:LDY&43C:STZ&75:.Loop6Rot:LD
X&420:STZ&74:.Loop7Rot:PHY:PHX:JSR GetVa
lue:LDY&78:LDA&B00,Y:STA(&70):PLX:PLY
3047 INC&78:INX:INC&74:LDA&74:CMP#4:BCC
Loop7Rot:INY:INC&75:LDA&75:CMP#4:BCC Lo
op6Rot
3048 .Display`Shape`Exit:JSR Display`Cu
rr`Shape:RTS
3050 ]:NEXT
3060 ENDPROC
3070 DEFPROCCreate`New`Tetfile
3080 TETFILE=OPENOUT("TETFILE")
3090 FORI%=1TO10:PRINT#TETFILE,"COMPUTE
R ",0,0
3100 NEXT
3110 CLOSE#TETFILE
3120 ENDPROC
3130 FORI%=220 TO 4 STEP-12:SOUND1,-15,
I%,2:NEXT
3140 FORI%=4 TO 28:PRINTTAB(16,I%);SPC(
15):NEXT
3150 PRINTTAB(16,5);"You Scored ";L%;"
Lines"
3160 PRINTTAB(16,6);"and a Score of ";S
%
3170 DIM N$(10),L(10),S(10)
3180 TETFILE=OPENIN("TETFILE")
3190 COLOUR3
3200 PRINTTAB(16,8)"TOP TEN SCORE TABLE
"
3210 PRINTTAB(16,9)"```````````````````
"
3220 PRINTTAB(16,12)"NAME LINES SC
ORE"
3230 PRINTTAB(16,13)"``````````````````
```"
3240 FORI%=1 TO 10
3250 INPUT#TETFILE,N$(I%),L(I%),S(I%)
3260 PRINTTAB(16,13+I%)LEFT$(N$(I%),10)
;TAB(27,13+I%)STR$(L(I%));TAB(32,13+I%)S
TR$(S(I%))
3270 NEXT
3280 CLOSE#TETFILE
3290 IFL%>L(10) OR(L%=L(10) AND S%>S(10
)) PROCNew`Name
3300 PRINTTAB(16,28)"Another go? (Y/N)
";:REPEATA$=GET$:UNTILA$="Y"ORA$="y"ORA$
="N"ORA$="n":PRINTA$;:IFA$="Y"ORA$="y" C
HAIN"TITLE" ELSECLS:PRINT"END.":END
3310 END
3320 DEFPROCNew`Name
3330 *FX15,1
3340 PRINTTAB(16,25);"You're in the Top
Ten"
3350 PRINTTAB(16,26);"Enter Name>";
3360 C%=0:NAME$=" ":NAME$
=""
3370 REPEAT
3380 REPEATA$=GET$:UNTILA$=CHR$13 OR (A
$>CHR$31 AND A$<CHR$128)
3390 IFA$=CHR$127 AND C%>0 C%=C%-1:NAME
$=LEFT$(NAME$,C%):VDU127
3400 IFA$<>CHR$127 AND A$<>CHR$13 AND C
%<10 C%=C%+1:NAME$=NAME$+A$:PRINTA$;
3410 UNTILA$=CHR$13
3420 I%=10
3430 REPEAT
3440 IF(L%>L(I%) OR (L%=L(I%) ANDS%>S(I
%))) ANDI%>1 N$(I%)=N$(I%-1):L(I%)=L(I%-
1):S(I%)=S(I%-1)
3450 I%=I%-1
3460 UNTIL I%=0 OR L%<L(I%) OR (L%=L(I%
) ANDS%<=S(I%))
3470 N$(I%+1)=NAME$:L(I%+1)=L%:S(I%+1)=
S%
3480 FORI%=1 TO 10
3490 PRINTTAB(16,13+I%)LEFT$(N$(I%)+"
",10);TAB(27,13+I%)STR$(L(I%));TAB(
32,13+I%)STR$(S(I%))
3500 NEXT
3510 TETFILE=OPENOUT("TETFILE")
3520 FORI%=1 TO 10
3530 PRINT#TETFILE,N$(I%),L(I%),S(I%)
3540 NEXT
3550 CLOSE#TETFILE
3560 ENDPROC
11170 A$=INKEY$(0)