home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel Volume 2 #1
/
carousel.iso
/
comdore
/
64games
/
typer
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
1989-02-15
|
8KB
|
295 lines
100 REM ELECTRONIC TYPEWRITER
110 REM (null)(null) (null)ATNCHR$RIGHT$(null)ATN(null) 2/15/89
120 REM
130 REM
140 REM
150 REM
160 REM
170 REM
180 REM
190 REM
200 REM
210 POKE53281,0:POKE53280,0:POKE53272,23:POKE657,128:POKE650,128
220 POKE646,15:FORI=54272TO54296:READ S:POKEI,S:NEXT
230 T$="[197]LECTRONIC [212]YPEWRITER":PRINT"[147]"TAB(9);
240 FORT=1TO LEN(T$):PRINT MID$(T$,T,1);:GOSUB900:FOR J=1 TO RND(1)*200+35
250 NEXT:NEXT:GOSUB880:X=7:Y=24:GOSUB1320:PRINT"[208]RESS [210][197][212][213][210][206][146] TO CONTINUE.";
260 POKE198,0
270 GET K$:IF K$<>CHR$(13)THEN270
280 REM
290 PRINT"[147][201]NITIALIZING..."
300 FORI=1TO80:BL$=BL$+" ":NEXT
310 RM=5
320 LM=5
330 SP=2
340 PR=0
350 MX=54:DIM TX$(MX),TP$(MX):LN=1:M=3
360 GOSUB1510:GOSUB2490:GOSUB790
370 REM
380 ON M GOSUB390,450,570,740,1340:GOTO380
390 REM
400 S$=F1$:T$=" [197]NTER A 1-"+MID$(STR$(MX),2)+" "
410 X=13:Y=2:L=2:B=48:T=57:GOSUB940:IFS$=""THENGOSUB860:GOTO410
420 F1$=S$:IF VAL(F1$)<1 OR VAL(F1$)>MX THEN GOSUB1280:M=1:GOTO410
430 IF VAL(F1$)<>LN THENLN=VAL(F1$):GOSUB790
440 RETURN
450 REM
460 S$=LEFT$(TP$(LN),1)
470 X=34:Y=2:L=1:B=66:T=69:GOSUB940:TP$(LN)=S$+MID$(TP$(LN),2):C$=LEFT$(S$,1)
480 IF C$<>"[196]"AND C$<>"D"THENTP$(LN)=C$:X=35:Y=2:GOSUB1320:PRINT" ";:RETURN
490 IF LEN(S$)>1AND K<>13 THEN RETURN
500 S$="":IF LEN(TP$(LN))>1THEN S$=MID$(TP$(LN),3)
510 M=2:X=36:Y=2:L=2:B=48:T=57:GOSUB940:IF S$=""THEN S$="0"
520 T=80-LM-RM-LEN(TX$(LN))-VAL(S$):IF T+1>0THEN550
530 T=T+VAL(S$):T$=MID$(STR$(T),2)
540 T$=" [197]NTER A 0-"+T$+LEFT$(BL$,3-LEN(T$)):GOSUB1280:GOTO510
550 TP$(LN)=C$+" "+S$
560 RETURN
570 REM
580 S$=TX$(LN)
590 L=80-LM-RM:C$=LEFT$(TP$(LN),1):IF C$="D" THEN L=L-VAL(MID$(TP$(LN),3))
600 POKE646,7:X=0:Y=8:B=32:T=95:GOSUB940:POKE646,15:TX$(LN)=S$
610 IF M<>3 THEN RETURN
620 ON PR+1 GOTO630,640
630 LN=LN-(LN<MX):GOSUB790:GOTO580
640 IF C$=""THENC$="A"
650 ON ASC(C$)-64+128*(ASC(C$)>70) GOSUB670,680,710,720,730,670
660 GOSUB790:GOTO580
670 PRINT#4,LEFT$(BL$,LM)TX$(LN);
680 FORI=1TOSP:PRINT#4:NEXT
690 LN=LN-(LN<MX)
700 RETURN
710 PRINT#4,LEFT$(BL$,INT((80-LEN(TX$(LN)))/2))TX$(LN);:GOTO680
720 PRINT#4,LEFT$(BL$,LM+VAL(MID$(TP$(LN),3)))TX$(LN);:GOTO680
730 PRINT#4,LEFT$(BL$,80-RM-LEN(TX$(LN)))TX$(LN);:GOTO680
740 REM
750 S$=F7$:POKE232,PEEK(232)OR128
760 X=6:Y=15:L=1:B=49:T=54:GOSUB940:F7$=S$:IF M<>4THEN RETURN
770 IF F7$=""THEN T$=" [211]ELECT A 1-6 ":GOSUB1280:GOTO760
780 ON VAL(F7$)GOSUB2310,1670,1830,2010,2120,1390:GOTO740
790 REM
800 F1$=MID$(STR$(LN),2):POKE212,0
810 X=13:Y=2:GOSUB1320:PRINT" [157][157]"F1$:X=34:GOSUB1320:PRINT" [157][157][157][157]"TP$(LN)
820 POKE781,8:SYS59903:POKE781,9:SYS 59903:X=0:Y=8:GOSUB1320
830 POKE212,0:POKE646,7:PRINTTX$(LN);:POKE212,0:POKE646,15
840 POKE212,0:POKE225,PEEK(225)OR128:POKE226,PEEK(226)AND127
850 RETURN
860 REM BEEP
870 FORI=1TO2:POKE54283,33:FOR J=1TO75:NEXT:POKE54283,32:NEXT:RETURN
880 REM DING
890 POKE54276,17:POKE54276,16:RETURN
900 REMTHWACK
910 POKE54290,129:FORI=1TO5:POKE54290,128:RETURN
920 REM
930 S$=""
940 GOSUB1320:S=1024+X+Y*40:POKE213,L+X:X=0:POKE198,0
950 GOSUB1170:IFK=13THEN1150
960 IF IOTHEN990
970 IF K<138 AND K>132 AND K-132<>M THEN M=K-132:GOTO1150
980 IF K=16THENGOSUB1210:GOTO950
990 GOSUB1000:GOTO950
1000 IFX=0THEN1030
1010 IFK=20THENK$="":I=-1:GOTO1110
1020 IF K=157THENI=-1:GOTO1140
1030 IFX=LTHEN1160
1040 IFX=LEN(S$)THEN1070
1050 IFK=29THENI=1:GOTO1140
1060 IFK=148ANDLEN(S$)<LTHEN K$=" "+MID$(S$,X+1,1):GOTO1100
1070 IF K<B OR K>TTHEN1160
1080 IFIOAND(K=34 OR K=36 OR K=42 OR K=44 OR K=58 OR K=63 OR K=64)THEN1160
1090 I=0
1100 X=X+1:IF X=L-5ANDIO=0 THEN GOSUB880
1110 S$=LEFT$(S$,X-1)+K$+MID$(S$,X+1)
1120 IF K$=""THEN K$=CHR$(20)
1130 IF LEN(K$)=2THENK$=CHR$(148):I=-1
1140 PRINT K$;:POKE216,0
1150 POKE204,1:POKES+X,PEEK(S+X)AND 127:X=X+I
1160 RETURN
1170 REM
1180 POKE204,0:POKE207,0:GET K$:IF K$=""THEN1180
1190 K=ASC(K$):IF K>192AND K<258 THEN K=K-128
1200 POKE212,0:RETURN
1210 REM
1220 PR=ABS(PR-1):ON PR+1 GOTO1230,1240
1230 CLOSE4:POKE1737,6:POKE1738,6:RETURN
1240 CLOSE4:OPEN4,4,7:POKE1737,14:POKE1738,32:RETURN
1250 REM
1260 OPEN15,8,15:INPUT#15,E,E$:IF E THEN T$=E$:GOSUB1300
1270 RETURN
1280 REM
1290 X=24:Y=22:GOSUB1320
1300 PRINT""T$"[146][155]";:GOSUB860:FORI=1TO2000:NEXT
1310 GOSUB1320:PRINT" ";:RETURN
1320 REM
1330 POKE781,Y:POKE782,X:POKE783,0:SYS65520:RETURN
1340 REM
1350 M=3:T$="[197]RASE ALL DATA?":GOSUB1280:GOSUB1450
1360 IF S$="[206]" OR S$="N" THEN X=24:Y=22:GOSUB1310:RETURN
1370 X=24:Y=22:GOSUB1320:PRINT" [160][197]RASING DATA ";:CLOSE4
1380 FORI=1TOMX:TX$(I)="":TP$(I)="":NEXT:GOSUB1510:GOSUB2490:LN=1:GOTO790
1390 REM
1400 T$=" [197]XIT PROGRAM? ":GOSUB1280:GOSUB1450
1410 IF S$="[206]"OR S$="N"THEN X=24:Y=22:GOSUB1310:RETURN
1420 PRINT"[147]":T$="BYE...":FORT=1TO LEN(T$):PRINTMID$(T$,T,1);:GOSUB900
1430 FORJ=1TO RND(1)*200+50:NEXT:NEXT:GOSUB880:POKE657,0:POKE650,0
1440 END
1450 REM
1460 IO=1:T$=" [193]RE YOU SURE? ":GOSUB1280
1470 X=24:Y=22:GOSUB1320:PRINT"[197]NTER A Y/N: N ";
1480 X=37:Y=22:S$="N":L=1:B=78:T=89:GOSUB940
1490 IF S$<>"[217]"AND S$<>"Y" AND S$<>"[206]"AND S$<>"N" THEN GOSUB860:GOTO1470
1500 IO=0:RETURN
1510 REM
1520 IO=1:PRINT"[147] [211]ET MARGINS AND LINE SPACING"
1530 X=0:Y=7:GOSUB1320:PRINT"[204]EFT MARGIN : [157][157][157]"LM:X=14:L=2:B=48:T=57
1540 S$=MID$(STR$(LM),2):GOSUB940:IF S$=""THEN GOSUB860:GOTO1530
1550 LM=VAL(S$):IF LM>39THENGOSUB860:GOTO1530
1560 X=0:Y=10:GOSUB1320:PRINT"[210]IGHT MARGIN : [157][157][157]"RM:X=15:L=2:B=48:T=57
1570 S$=MID$(STR$(RM),2):GOSUB940:IF S$=""THENGOSUB860:GOTO1560
1580 RM=VAL(S$):IF RM>39THENGOSUB 860:GOTO1560
1590 X=0:Y=13:GOSUB1320:PRINT"[204]INE SPACING : [157][157][157]"SP:X=15:L=1:B=49:T=50
1600 S$=MID$(STR$(SP),2):GOSUB940:IF S$=""THENGOSUB860:GOTO1590
1610 SP=VAL(S$)
1620 X=0:Y=16:GOSUB1320:PRINT"[201]S THIS CORRECT (Y/N)? : Y":X=25:L=1:B=78:T=89
1630 S$="Y":GOSUB940
1640 IFS$<>"[217]"AND S$<>"Y"AND S$<>"[206]"AND S$<>"N"THENGOSUB860:GOTO1620
1650 IF S$="[206]"OR S$="N"THEN1530
1660 IO=0:RETURN
1670 REM
1680 PRINT"[147] [204]OAD TEXT TO FILE":GOSUB2230:PRINT
1690 IF S$=""THEN1820
1700 IF K$="D"THEN1720
1710 OPEN1,1,0,S$+".X":GOTO1730
1720 OPEN1,8,8,"0:"+S$+".X"+",S,R":GOSUB1250:IF E THEN1820
1730 INPUT#1,J
1740 INPUT#1,LM
1750 INPUT#1,RM
1760 FORI=1TOMX:TX$(I)=""
1770 GET#1,S$:IF S$="[144]"THENS$=""
1780 IFS$=CHR$(13)THEN1800
1790 TX$(I)=TX$(I)+S$:GOTO1770
1800 NEXT
1810 IF J THEN GOSUB2070
1820 CLOSE1:CLOSE15:GOSUB2490:GOSUB790:RETURN
1830 REM
1840 PRINT"[147] [211]AVE TEXT FILE"
1850 X=0:Y=6:GOSUB1320:PRINT"[211]AVE TEXT WITH TEMPLATE (Y/N)? : N";:X=33
1860 L=1:B=78:T=89:S$="N":GOSUB940
1870 IF S$<>"[217]"AND S$<>"Y"AND S$<>"[206]" AND S$<>"N"THENGOSUB860:GOTO1850
1880 J=0:IF S$="[217]" OR S$="Y" THEN J=1
1890 GOSUB2230:PRINT:IF S$=""THEN2000
1900 IF K$="D"THEN1920
1910 OPEN1,1,1,S$+".X":GOTO1930
1920 OPEN1,8,8,"@0:"+S$+".X"+",S,W":GOSUB1250:IF E THEN2000
1930 PRINT#1,J
1940 PRINT#1,LM
1950 PRINT#1,RM
1960 FORI=1TOMX:S$=TX$(I):IF S$=""THEN S$="[144]"
1970 PRINT#1,S$
1980 NEXT
1990 IF J THEN GOSUB 2180
2000 CLOSE1:CLOSE15:GOSUB2490:GOSUB790:RETURN
2010 REM
2020 PRINT"[147] [204]OAD TEMPLATE":GOSUB2230:PRINT
2030 IF S$=""THEN2110
2040 IF K$="D"THEN2060
2050 OPEN1,1,0,S$+".P":GOTO2070
2060 OPEN1,8,8,"0:"+S$+".P"+",P,R":GOSUB1250:IFE THEN 2110
2070 INPUT#1,SP
2080 FORI=1TO MX
2090 INPUT#1,TP$(I):IF TP$(I)="[144]" THEN TP$(I)=""
2100 NEXT
2110 CLOSE1:CLOSE15:GOSUB2490:GOSUB790:RETURN
2120 REM
2130 PRINT"[147] [211]AVE TEMPLATE":GOSUB2230:PRINT
2140 IF S$=""THEN2220
2150 IF K$="D"THEN2170
2160 OPEN1,1,1,S$+".P":GOTO2180
2170 OPEN1,8,8,"@0:"+S$+".P"+",P,W":GOSUB1250:IF E THEN2220
2180 PRINT#1,SP
2190 FORI=1TOMX:S$=TP$(I):IF S$="" THENS$="[144]"
2200 PRINT#1,S$
2210 NEXT
2220 CLOSE1:CLOSE15:GOSUB2490:GOSUB790:RETURN
2230 REM
2240 F7$=""
2250 X=0:Y=8:GOSUB1320:PRINT"[197]NTER FILE NAME:";:IO=1:B=32:T=90:L=14:X=17
2260 GOSUB920:IO=0:IF S$=""THEN RETURN
2270 X=0:Y=10:GOSUB1320:PRINT"TAPE OR DISK (T/D)[157][157][157][157]";
2280 GETK$:IF K$<>"T" AND K$<>"[212]" AND K$<>"D" AND K$<>"[196]"THEN2280
2290 IF K$="D" OR K$="[196]"THEN PRINT"D":K$="D":RETURN
2300 PRINT"T":RETURN
2310 REM
2320 CLOSE4:OPEN4,4,7:T$="[160][208]RINT DOCUMENT":GOSUB1280
2330 S$=MID$(STR$(SP),2):X=24:Y=22:GOSUB1320:PRINT"[204]INE SPACING: [157][157]"S$
2340 X=37:L=1:B=49:T=50:GOSUB940:Y=22:X=24:GOSUB1310:IF S$=""THEN RETURN
2350 SP=VAL(S$)
2360 X=24:Y=22:GOSUB1320:PRINT"[198]IRST LINE: ":X=36:L=2:B=48:T=57:GOSUB920
2370 X=24:Y=22:GOSUB1310:IF S$="" THEN RETURN
2380 E=VAL(S$):IF E<1 OR E>MX THEN GOSUB860:GOTO2360
2390 X=24:Y=22:GOSUB1320:PRINT"[204]AST LINE: ":X=35:L=2:B=48=T=57:GOSUB920
2400 X=24:Y=22:GOSUB1310:IF S$="" THEN RETURN
2410 IF VAL(S$)<1 OR VAL(S$)>MX THEN GOSUB860:GOTO2390
2420 T$="[160][208]OSITION PAPER":GOSUB1280:X=24:Y=22:GOSUB1320
2430 PRINT" [208]RESS [210][197][212][213][210][206] ":POKE198,0
2440 GET K$:IF K$<>CHR$(13)THEN2440
2450 X=24:Y=22:GOSUB1310:S=LN:LN=E
2460 FOR J=LN TO VAL(S$):GOSUB790:C$=MID$(TP$(LN),1,1):IF C$="" THEN C$="A"
2470 ON ASC(C$)-64+128*(ASC(C$)>70) GOSUB670,680,710,720,730
2480 NEXT:LN=S:GOSUB790:RETURN
2490 REM
2500 PRINT"[147][155][198]1 ";
2510 PRINT" [198]3 ";
2520 PRINT"[176][192][192][192][192][192][192][192][192][192][192][192][154][178][192][192][192][174][155] ";
2530 PRINT" [176][192][192][192][192][192][192][192][192][192][154][178][192][192][192][192][192][174][155]";
2540 PRINT"[221][204]INE NUMBER[154][221] [221][155] ";
2550 PRINT" [221][204]INE CODE[154][221] [221][155]";
2560 PRINT"[173][192][192][192][192][192][192][192][192][192][192][192][154][177][192][192][192][189][155] ";
2570 PRINT" [173][192][192][192][192][192][192][192][192][192][154][177][192][192][192][192][192][189][155]";
2580 PRINT" ";
2590 PRINT" ";
2600 PRINT" ";
2610 PRINT" ";
2620 PRINT" [198]5 ";
2630 PRINT" ";
2640 PRINT"[158]12345678901234567890";
2650 PRINT"12345678901234567890";
2660 PRINT" ";
2670 PRINT" ";
2680 PRINT" ";
2690 PRINT" ";
2700 PRINT" ";
2710 PRINT" ";
2720 PRINT"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]";
2730 PRINT"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][155]";
2740 PRINT" ";
2750 PRINT" ";
2760 PRINT" [198]7 ";
2770 PRINT" ";
2780 PRINT"[176][192][192][192][192][154][178][192][192][174][155] ";
2790 PRINT" ";
2800 PRINT"[221] [165] ";
2810 PRINT" [[195][212][210][204]]-[208] ";
2820 PRINT"[171][192][192][192][192][154][177][192][192][177][155][192][192][192][192][192][192][192][192][192][192][192]";
2830 PRINT"[192][174] [176][192][192][192][192][192][192][192][178][192][192][192][174] ";
2840 PRINT"[221] 1 - [208]RINT DOCUMENT";
2850 PRINT" [221] [221][208]RINTER[221]O [221] ";
2860 PRINT"[221] 2 - [204]OAD TEXT FILE";
2870 PRINT" [155][221] [173][192][192][192][192][192][192][192][177][192][192][192][189] ";
2880 PRINT"[221] 3 - [211]AVE TEXT FILE";
2890 PRINT" [221] ";
2900 PRINT"[221] [149]4 - [204]OAD TEMPLATE ";
2910 PRINT" [155][221] ";
2920 PRINT"[221] 5 - [211]AVE TEMPLATE ";
2930 PRINT" [221] [176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]";
2940 PRINT"[221] 6 - [197]XIT PROGRAM ";
2950 PRINT" [155][221] [221] [221]";
2960 PRINT"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]";
2970 PRINT"[192][189] [173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]";
2980 ONPR+1 GOTO1230,1240
2990 REMSOUND DATA
3000 DATA000,110,000,000,016,009,009
3010 DATA000,064,000,000,032,000,240
3020 DATA000,128,000,000,128,000,240
3030 DATA000,016,132,079