8-Bit Software Online Conversion

Amoeba. Version 1 - Listing

0 DATA" " 10 DATA" 10 000 01 " 20 DATA" 10 111 01 " 30 DATA" 10 000 000 01 " 40 DATA" 10 111 111 01 " 50 DATA" 10 000 000 000 01 " 60 DATA" 10 111 111 111 01 " 70 DATA"10 000 000 000 000 01 " 80 DATA" 10 111 111 111 111 01 " 90 DATA" 10 000 000 1100 0101 " 100 DATA" 10 00010 0011 000 01 " 110 DATA" 10 000 00010 0011 01 " 120 DATA" 10 000 000 000 111 01 " 130 DATA" 10 00010 0011 1100 0101 " 140 DATA" 10 000 00010 0011 111 01 " 150 DATA" 10 111 111 1100 0101 " 160 DATA" 10 10111 0011 111 01 " 170 DATA" 10 10111 0011 1100 0101 " 180 DATA" 10 111 111 111 000 01 " 190 DATA" 10 111 10111 0 011 01 " 200 DATA" 10 111 10111 0 011 000 01 " 210 DATA" 10 1100 0011 01 " 220 DATA" 10 00010 0011 01 " 230 DATA" 10 000 000 111 01 " 240 DATA" 10 00010 0011 111 01 " 250 DATA" 1010 0011 1100 0101 " 260 DATA" 10 111 111 000 01 " 270 DATA" 10 10111 0011 01 " 280 DATA" 10 10111 0011 000 01 " 290 DATA" 1010 0011 111 01 " 300 DATA" 1010 0011 000 01 " 310 DATA" 1010 00100 0001 01 " 320 DATA" 10 1000 0011 000 01 " 330 DATA" 10 1000 00100 0001 01 " 340 DATA" 10 1110 0011 111 01 " 350 DATA" 1010 11011 0111 01 " 360 DATA" 10 1110 11011 0111 01 " 370 DATA" 1010 10011 0011 01 " 380 DATA" 101010 000011 0011 01 " 390 DATA" 10 1000 0011 111 01 " 400 DATA" 10 000 1000 0011 111 01 " 410 DATA" 1010 00110 0011 01 " 420 DATA" 101010 001111 0011 01 " 430 DATA" 10 1110 0011 000 01 " 440 DATA" 10 111 1110 0011 000 01 " 450 MODE4 460 ONERRORPROCerror 470 *KEY10"OLD|M" 480 DIM yourhand$(2),myhand$(2) 490 DIM yourcomp$(5),mycomp$(5) 500 PROCinit 510 520 REPEAT 530 IF turn% THEN PRINTTAB(1,1)"**** M OVE ****"TAB(25,1)" " ELSE PRINTTAB(1,1)" "TAB(25,1)"* *** MOVE ****" 540 IF Y%=6 OR M%=6 THEN PRINTTAB(1,4) "GAME OVER PRESS A KEY FOR ANOTHER":A=GE T:RUN 550 PROCflash 560 PROCpboard 570 PROCkeys 580 PROCscores 590 UNTIL FALSE 600 610 END 620 630 DEFPROCkeys 640 IF K% A$=INKEY$(50) ELSE PROCpaddl es 642 REM***************************** 644 REM these lines may be removed 650 IFA$="S" THEN PROCshowpak 660 IFA$="Q" THEN PROCshowcomps 680 IFA$="T" THEN PROCshowstr 690 IFA$="C" THEN PROCcycle 710 IFA$="P" THEN PROCtestcard 712 REM***************************** 720 IFA$=CHR$(8) THEN myhand%=myhand% EOR 1:A$="H" 730 IFA$="H" THEN PROCpcards 740 Q%=INSTR("! AZaz,.<>",A$) 750 IFQ%=2 PROCadjust:PROCpboard:PROCt urn 760 IFQ%<3 ENDPROC 770 IF(Q%=7ORQ%=9) xpos%=FNdec(xpos%) 780 IF(Q%=8ORQ%=10) xpos%=FNinc(xpos%) 790 IF(Q%=4ORQ%=6) ypos%=FNinc(ypos%) 800 IF(Q%=3ORQ%=5) ypos%=FNdec(ypos%) 810 IFQ%>2 AND Q%<11 PROCmove 820 ENDPROC 830 840 DEFPROCpaddles 850 A$="" 860 IF turn% M=1:F=1 ELSE M=3:F=2 870 IF ADVAL(M) < 20000 A$="." 880 IF ADVAL(M) > 50000 A$="," 890 IF ADVAL(M+1) < 20000 A$="Z" 900 IF ADVAL(M+1) > 50000 A$="A" 910 X=ADVAL(0) AND 3 920 IF X=F THEN A$=" " 930 ENDPROC 940 950 DEFPROCturn 960 IF turn% PROCyourtest:PROCmytest ELSE PROCmytest:PROCyourtest 970 turn%=turn% EOR 1 980 ENDPROC 990 1000 DEFPROCadjust 1010 IF ?addr%=244 OR ?addr%=246 ?addr% =245:ENDPROC 1020 IF ?addr%=245 OR ?addr%=247 ?addr% =244 1030 ENDPROC 1040 1050 DEFFNdec(var%) 1060 IF var%>0 THEN var%=var%-1 ELSE *F X15,0 1070 =var% 1080 1090 DEFFNinc(var%) 1100 IF var%<6 THEN var%=var%+1 ELSE *F X15,0 1110 =var% 1120 1130 DEFFNstrip(N$) 1140 REPEAT 1150 T$=MID$(N$,1,1) 1160 IF T$=" " N$=MID$(N$,2) 1170 UNTIL T$<>" " 1180 REPEAT 1190 T$=MID$(N$,LEN(N$)) 1200 IF T$=" " N$=MID$(N$,1,LEN(N$)-1) 1210 UNTIL T$<>" " 1220 =N$ 1230 1240 DEFPROCmove 1250 PROCnotinv 1260 addr%=&900+(ypos%*7)+xpos% 1270 ENDPROC 1280 1290 DEFPROCflash 1300 IF ?addr%=244 ?addr%=246:ENDPROC 1310 IF ?addr%=245 ?addr%=247:ENDPROC 1320 PROCnotinv 1330 ENDPROC 1340 1350 DEFPROCnotinv 1360 IF ?addr%=246 ?addr%=244 1370 IF ?addr%=247 ?addr%=245 1380 ENDPROC 1390 1400 DEFPROCpboard 1410 FOR SY%=1 TO 49 STEP 7 1420 N%=SY% DIV 7 +14 1430 PRINTTAB(17,N%)MID$($&900,SY%,7) 1440 NEXT 1450 PROCshow10 1460 ENDPROC 1470 1480 DEFPROCscores 1490 PRINTTAB(11,0)STR$(yourscore%) 1500 PRINTTAB(35,0)STR$(myscore%) 1510 ENDPROC 1520 1530 DEFPROCpcards 1540 FOR I=0 TO 2 1550 PROCdocard(I) 1560 NEXT 1570 ENDPROC 1580 1590 DEFPROCdocard(N) 1600 IF N=0 PROCgetcard(yourhand$(0)): PROCdcard(1,6,G$):PROCdcard(9,6,FNinv(G$ )):PROCgetcard(myhand$(0)):PROCdcard(25, 6,G$):PROCdcard(33,6,FNinv(G$)) 1610 IF N=1 PROCgetcard(yourhand$(1)):P ROCdcard(1,14,G$):PROCdcard(9,14,FNinv(G $)):PROCgetcard(myhand$(1)):PROCdcard(25 ,14,G$):PROCdcard(33,14,FNinv(G$)) 1620 IF N=2 PROCgetcard(yourhand$(2)):P ROCdcard(1,22,G$):PROCdcard(9,22,FNinv(G $)):PROCgetcard(myhand$(2)):PROCdcard(25 ,22,G$):PROCdcard(33,22,FNinv(G$)) 1630 ENDPROC 1640 1650 DEFPROCgetcard(num$) 1660 IF num$="DONE" THEN num$=CHR$(0) 1670 RESTORE ASC(num$)*10 1680 READ G$ 1690 ENDPROC 1700 1710 DEFPROCdcard(x,y,G$) 1720 FOR SY%=1 TO LEN(G$) STEP 7 1730 N%=SY% DIV 7 +y 1740 C$=MID$(G$,SY%,7) 1750 PRINTTAB(x,N%); 1760 FOR I%=1 TO 7 1770 IF MID$(C$,I%,1)="1" VDU244 1780 IF MID$(C$,I%,1)="0" VDU245 1790 IF MID$(C$,I%,1)=" " VDU32 1800 NEXT 1810 NEXT 1820 ENDPROC 1830 1840 DEFPROCmkcomps 1850 FOR I=0 TO 2 1860 PROCdocomps(I) 1870 NEXT 1880 ENDPROC 1890 1900 DEFPROCdocomps(N) 1910 PROCgetcard(yourhand$(N)):PROCdoyo urcomp(N) 1920 IF yourmatch% ENDPROC 1930 PROCgetcard(myhand$(N)):PROCdomyco mp(N) 1940 ENDPROC 1950 1960 DEFPROCdomycomp(N) 1970 U$=FNinv(G$):mycomp$(N)=FNstrip(G$ ):mycomp$(N+3)=FNstrip(U$) 1980 ENDPROC 1990 2000 DEFPROCdoyourcomp(N) 2010 U$=FNinv(G$):yourcomp$(N)=FNstrip( G$):yourcomp$(N+3)=FNstrip(U$) 2020 ENDPROC 2030 2040 DEFPROCinit 2050 PRINT''" ********* ACTIVE KEYS ** *******" 2060 PRINT''TAB(10)" A...UP" 2070 PRINTTAB(10)" Z...DOWN" 2080 PRINTTAB(10)" <...LEFT" 2090 PRINTTAB(10)" >...RIGHT" 2100 PRINT" SPACE BAR...TOGGLE" 2110 PRINT''TAB(10)"PRESS P FOR PADDLES "'' 2120 Q$=GET$ 2130 IF Q$="P" OR Q$="p" THEN K%=0 ELSE K%=1 2140 *LOAD"AMFMC" 2150 VDU23,1,0;0;0;0; 2160 VDU19,0,4;0;0;0; 2170 VDU23,244,&18,&18,&30,&E3,&C7,&0C, &18,&18 2180 VDU23,245,&18,&18,&0C,&C7,&E3,&30, &18,&18 2190 VDU23,246,&E7,&E7,&CF,&1C,&38,&F3, &E7,&E7 2200 VDU23,247,&E7,&E7,&F3,&38,&1C,&CF, &E7,&E7 2210 *FX4,1 2220 S1$="XXXXXXX":S2$="XXXXXXX" 2230 xpos%=0:ypos%=0:addr%=&900 2240 t1$=CHR$(244) 2250 t2$=CHR$(245) 2260 S1$=t1$+t2$+t1$+t2$+t1$+t2$+t1$ 2270 S2$=t2$+t1$+t2$+t1$+t2$+t1$+t2$ 2280 $&900=S1$+S2$+S1$+S2$+S1$+S2$+S1$ 2290 PRINT" PLEASE WAIT WHILE I SET T HINGS UP" 2300 nocomp%=0:yourmatch%=FALSE 2310 PROCshuffle 2320 PROCmkhands 2330 PROCmkcomps 2340 CLS 2350REM PRINTTAB(0,0)" YOUR SCORE :" 2360 PRINTTAB(0,0)" PLAYER 1 :" 2370REM PRINTTAB(24,0)" MY SCORE :" 2380 PRINTTAB(24,0)" PLAYER 2 :" 2390 PRINTTAB(0,2)" CARDS CARDS" 2400 PRINTTAB(24,2)" CARDS CARDS" 2410 PRINTTAB(0,3)" NORMAL TURNED" 2420 PRINTTAB(24,3)" NORMAL TURNED" 2430 M%=0:Y%=0 2440 turn%=1:yourscore%=0:myscore%=0 2450 PROCscores 2460 PROCpcards 2470 ENDPROC 2480 2481 DEFPROCshuffle 2482 pack$="" 2483 FOR I%=0 TO 44:pack$=pack$+CHR$(I% ):NEXT 2484 FOR I%=1 TO 100 2485 REPEAT:X%=RND(LEN(pack$)):UNTIL X% >1 2486 pack$=MID$(pack$,1,X%-1)+MID$(pack $,X%+1)+MID$(pack$,X%,1) 2487 NEXT 2488 ENDPROC 2489 2490 DEFPROCerror 2500 VDU23,1,1;0;0;0; 2510 *FX4,0 2520 END 2530 ENDPROC 2540 2550 DEFPROCmkhands 2560 FOR H%=0 TO 1 2570 FOR I%=0 TO 2 2580 IF H% THEN myhand$(I%)=FNpickup EL SE yourhand$(I%)=FNpickup 2590 NEXT 2600 NEXT 2610 ENDPROC 2620 2630 DEFFNpickup 2640 IF LEN(pack$)=1 THEN ="DONE" 2650 card$=MID$(pack$,LEN(pack$)) 2660 pack$=MID$(pack$,1,LEN(pack$)-1) 2670 =card$ 2680 2690 DEFFNinv(use$) 2700 rev$="" 2710 FOR W%=LEN(use$) TO 1 STEP -1 2720 rev$=rev$+MID$(use$,W%,1) 2730 NEXT 2740 =rev$ 2750 2760 DEFPROCyourtest 2770 F%=0:Y%=0 2780 REPEAT 2790 ?&76=0 2800 $&980=yourcomp$(F%) 2810 IF LEN($&980)>1 PROCtestbits ELSE Y%=Y%+1 2820 IF ?&76=0 F%=F%+1 2830 UNTIL F%=6 OR ?&76 2840 IF ?&76 PROCyourmatch 2850 ENDPROC 2860 2870 DEFPROCyourmatch 2880 yourmatch%=TRUE 2890 yourscore%=yourscore%+1 2900 yourcomp$(F%)="0" 2910 IF F%>2 yourcomp$(F%MOD3)="0" 2920 IF F%<3 yourcomp$(F%+3)="0" 2930 yourhand$(F%MOD3)=FNpickup 2940 PROCdocard(F%MOD3):PROCdocomps(F%M OD3) 2950 turn%=0:yourmatch%=FALSE 2960 ENDPROC 2970 2980 DEFPROCmytest 2990 F%=0:M%=0 3000 REPEAT 3010 ?&76=0 3020 $&980=mycomp$(F%) 3030 IF LEN($&980)>1 PROCtestbits ELSE M%=M%+1 3040 IF ?&76=0 F%=F%+1 3050 UNTIL F%=6 OR ?&76 3060 IF ?&76 PROCmymatch 3070 ENDPROC 3080 3090 DEFPROCmymatch 3100 myscore%=myscore%+1 3110 mycomp$(F%)="0" 3120 IF F%>2 mycomp$(F%MOD3)="0" 3130 IF F%<3 mycomp$(F%+3)="0" 3140 myhand$(F%MOD3)=FNpickup 3150 PROCdocard(F%MOD3):PROCdocomps(F%M OD3) 3160 turn%=1 3170 ENDPROC 3180 3190 DEFPROCtestbits 3200 !&70=&980:!&72=&980:!&74=&940 3210 CALL &A00 3220 ENDPROC 3230 3240 DEFPROCshow10 3250 use$=STRING$(49," ") 3260 FOR I%=1 TO LEN($&900) 3270 A%=ASC(MID$($&900,I%,1)) 3280 IF A%=244 OR A%=246 ?(&940+I%-1)=4 9 ELSE ?(&940+I%-1)=48 3290 NEXT 3300 ?(&940+I%-1)=13 3310 ENDPROC 3390 3391REM******************************* 3392REM These procedures may be removed 3400 DEFPROCtestcard 3410 REPEAT 3430 PRINTTAB(17,1)"CARD" 3440 PRINTTAB(17,2)"No.1-44" 3450 PRINTTAB(17,3); 3460 INPUTcard% 3470 PRINTTAB(17,1);" " 3480 PRINTTAB(17,2);" " 3490 PRINTTAB(17,3);" " 3510 RESTORE card%*10 3520 READ use$ 3530 PROCdcard(17,6,use$) 3540 IFcard%<>0 A=GET 3550 inv$=FNinv(use$) 3560 PROCdcard(17,6,inv$) 3570 UNTIL A=13 OR card%=0 3580 ENDPROC 3590 3600 DEFPROCcycle 3610 FOR card%=LEN(pack$)+5 TO 0 STEP - 1 3620 PRINTTAB(20,2)STR$(card%)" " 3630 RESTORE card%*10 3640 READ G$ 3650 PROCdcard(17,6,G$) 3660 A$=INKEY$(100) 3670 IFA$=" " THEN REPEAT:A$=GET$:UNTIL A$=" " 3680 RESTORE 0 3690 READ G$ 3700 PROCdcard(17,6,G$) 3710 NEXT 3720 PRINTTAB(20,2)" " 3730 ENDPROC 3740 3860 DEFPROCshowpak 3870 PROCclear 3880 PRINTTAB(0,5); 3890 FOR I%=1 TO LEN(pack$) 3900 PRINTSTR$(ASC(MID$(pack$,I%,1)))" "; 3910 NEXT 3920 PRINT' 3930 FOR N%=0 TO 1 3940 PRINT" "; 3950 FOR I%=0 TO 2 3960 IF N% THEN PRINTSTR$(ASC(myhand$(I %)))" "; ELSE PRINTSTR$(ASC(yourhand$(I% )))" "; 3970 NEXT 3980 NEXT 3990 PRINT'"PRESS ANY KEY":A=GET:PROCcl ear 4000 A$="H" 4010 ENDPROC 4020 4030 DEFPROCshowstr 4040 PROCclear 4050 PROCgetcard(myhand$(0)) 4060 T$=FNstrip(G$) 4070 PRINTTAB(0,7)"X"G$"X" 4080 PRINT'"X"T$"X" 4090 PRINT'"PRESS ANY KEY":A=GET:PROCcl ear 4100 A$="H" 4110 ENDPROC 4120 4130 DEFPROCclear 4140 FOR I%=5 TO 13 4150 PRINTTAB(0,I%)STRING$(40," ") 4160 NEXT 4170 ENDPROC 4180 4190 DEFPROCshowcomps 4200 PROCclear 4210 PRINTTAB(0,5); 4220 FOR I%=0 TO 5 4230 PRINTyourcomp$(I%) 4240 NEXT 4250 PRINT"PRESS ANY KEY":A=GET:PROCcle ar 4260 PRINTTAB(0,5); 4270 FOR I%=0 TO 5 4280 PRINTmycomp$(I%) 4290 NEXT 4300 PRINT"PRESS ANY KEY":A=GET:PROCcle ar 4310 A$="H" 4320 ENDPROC