10 REM ** TELE-BATTLE V1.1 ** V1.3 MODS 20 REM ** BY JULIAN BURGER ** APRIL 5, 1988 30 REM ** OCTOBER 5,1987 ** 40 REM -THE FIRST IN A SERIES 50 REM ----OF MODEM GAMES 60 REM ** ALL WILL BE FREEWARE ** 70 REM ** BUT DON'T CHANGE THE ** 80 REM ** PROGRAM AROUND OR MY ** 90 REM ** NAME, PLEASE!! ** 100 POKE53281,.:POKE53280,.:POKE820,16-(PEEK(56577)AND16) 105 GOSUB5000 110 OPEN5,2,.,""+CHR$(0) 120 DIMG%(9,9),S$(4),L%(4),H%(1),N$(1):FORI=.TO4:READS$(I),L%(I):NEXT 130 DATAPT BOAT,2,DESTROYER,3,SUBMARINE,3,BATTLESHIP,4,CARRIER,5 140 CR$=CHR$(13):DL$=CHR$(20):SP$=" ":LC$=SP$+SP$+" ":RM$=LC$:PL$="":SD=54272:FORI=.TO24:POKESD+I,.:NEXT:CR%=PEEK(820) 150 FORI=1TO20:IN$=IN$+CHR$(148):NEXT 160 REM ** MAIN MENU ** 170 PRINT"[147][155][142]"TAB(9)"** TELE-BATTLE V1.3 **":PRINTTAB(9)"** BY JULIAN BURGER ** 180 [153]"MODEM STATUS:";:[141]2000:[139]RT%[179][177]CR%[167][153]"NO "; 190 [153]"CARRIER":[153]"[1] SEND MODEM COMMAND 200 PRINT"[2] START GAME" 210 PRINT"[3] QUIT" 220 PRINT"SELECT -->";:GOSUB2000 230 IF(PEEK(56577)AND16)<>RT%THEN170 240 GETA$:IFA$<"1"ORA$>"3"THEN230 250 PRINTA$ 260 IFRT%=CR%THEN280 270 IFA$="2"THENPRINT"YOU MUST BE ON-LINE TO PLAY":FORI=1TO1100:NEXT:GOTO170 280 IFA$="3"THENCLOSE5:CLOSE15:PRINT"[147]";:END 290 IFA$="1"THEN320 300 IFA$="2"THEN360 310 REM ** MODEM COMMAND ** 320 PRINT"COMMAND -->";:LG%=20:GOSUB1490:IFI$=""THEN170 330 IFI$="+++"THENPRINT#5,I$;:GOTO170 340 PRINT#5,I$:GOTO170 350 REM ** START NEW GAME ** 360 PL%=.:PRINT"[147]YOU MAY CHAT NOW, PRESS F1 WHEN 370 [153]"YOU ARE READY TO BEGIN... 380 GOSUB1600:GOSUB1800:POKE198,. 390 PRINT"[154]ENTER YOUR NAME -->";:LG%=10:GOSUB1490:N$(.)=I$:I$=" 400 [153]"GETTING OPPONENTS NAME...":[141]1800:[141]1870:[152]5,""N$(.) 410 [161]#5,A$:[139]A$[179][177]""[167]410 420 [161]#5,A$:[139]A$[178]CR$[167]450 430 [139]A$[177]""[167]I$[178]I$[170]A$ 440 [137]420 450 N$(1)[178]I$ 460 [143] ** INPUT SHIPS ** 470 [153]"LOADCLRPLACE YOUR SHIPS: 480 PRINT" [154]ABCDEFGHIJ":PRINT" [172][162][162][162][162][162][162][162][162][162][187]":FORY=.TO9 490 PRINT"[154]"CHR$(48+Y)"[152]..........[146][161]":NEXT:PRINT"[145]"TAB(11)"[190] 500 [153]""[163]22)"PRINTUSE CURSOR KEYS":[153][163]22)"TO MOVE; RETURN 510 PRINTTAB(25)"TO PLACE. 520 [153][163]22)"USE CURSOR KEYS":[153][163]25)"TO SELECT":[153][163]25)"DIRECTION 530 PRINTTAB(27)"[158]SHIP: 540 BS%[178]1225:BL%[178]BS%[170]20:CL[178]54272:X%[178].:Y%[178]. 550 [129]S[178].[164]4 560 [143] ** PLACE SHIP ** 570 [153]"SYS"[163]20)SP$ 580 [153]"ON"[163]30[171]([195](S$(S))[173]2)[171].5)S$(S) 590 L%[178]BS%[170]Y%[172]40[170]X%:P%[178][194](L%):[151]L%,P%[171]128 600 [141]1460:[139]A$[178]CR$[167]710 610 [139]A$[179][177]"ON"[175]A$[179][177]""[175]A$[179][177]"CMD"[175]A$[179][177]""[167]600 620 [139]A$[178]"ON"[167]Y%[178]Y%[171]1 630 [139]A$[178]""[167]Y%[178]Y%[170]1 640 [139]A$[178]"CMD"[167]X%[178]X%[171]1 650 [139]A$[178]""[167]X%[178]X%[170]1 660 [151]L%,P%:[139]Y%[179].[167]Y%[178]9 670 [139]Y%[177]9[167]Y%[178]. 680 [139]X%[179].[167]X%[178]9 690 [139]X%[177]9[167]X%[178]. 700 [137]590 710 [139]G%(X%,Y%)[167]660 720 [153]PL$"PRINTDIRECTION? 730 GOSUB1460:IFA$=CR$THENPRINTPL$SP$:GOTO660 740 IFA$<>"[145]"ANDA$<>""ANDA$<>"[157]"ANDA$<>""THEN730 750 DY%=1*(A$="[145]")-1*(A$=""):DX%=1*(A$="[157]")-1*(A$="") 760 XX%=X%:YY%=Y%:E%=.:FORI=2TOL%(S) 770 XX%=XX%+DX%:YY%=YY%+DY% 780 IFXX%<.ORXX%>9ORYY%<.ORYY%>9THENE%=1:GOTO800 790 IFG%(XX%,YY%)THENE%=1 800 NEXT:IFE%THEN720 810 XX%=X%:YY%=Y%:FORI=1TOL%(S):G%(XX%,YY%)=S+1 820 Z%=YY%*40+XX%:POKECL+BS%+Z%,15:POKEBS%+Z%,ASC(S$(S))+64 830 XX%=XX%+DX%:YY%=YY%+DY%:NEXT:PRINT"[145]"SP$:NEXT 840 PRINTPL$"[155]WAITING FOR OPPONENT TO SETUP...":GOSUB1800 850 REM ** WHO GOES FIRST? ** 860 A%=(PEEK(162)AND15)+1 870 PRINT#5,CHR$(A%); 880 GET#5,A$:IFA$=""THEN880 890 B%=ASC(A$):IFA%=B%THEN860 900 PRINTPL$SP$SP$PL$;:IFB%