10 REM ++++++++++++++++++++++++++++++++ 20 REM ! Program .... SPRINV3 30 REM ! Utg}va 4.1 21/8 1982 40 REM ! av (c) Johan Andersson 50 REM ! Minne 16 Kbytes 60 REM ++++++++++++++++++++++++++++++++ 70 GOSUB 2600 : GOTO 140 80 A%=PEEK(61840%) : A1%=PEEK(61841%) 90 A2%=FIX(RND*(A1%-(A%-1%)))+A% 100 A2%=A2% AND 255% 110 POKE 61842%,A2% 120 RETURN 140 RANDOMIZE 150 GOSUB 2840 160 K=3 : P=0 : S%=1% : B%=1% 170 RESTORE 180 174 REM  180 -- Kan {ndras 175 REM  Bonus gr{nser 176 REM  [ndra {ven FOR-satsen 177 REM  p} rad 190 och IF p} rad 1340 180 DATA 4000,7000,10000,15000 190 FOR C%=1% TO 4% : READ A% 200 B%(C%)=A% : NEXT C% 220 ; CHR$(12) 230 FOR C%=0% TO 21% 240 ; CUR(C%,0)CHR$(151%); : NEXT C% 250 ; CUR(21,1)STRING$(39,35); 260 ; CUR(22,1)"PO[NG:"P; 270 ; CUR(23,1)"KANONER:"K; 280 ; CUR(22,17)"REKORD:"R%(1)CUR(23,17)"NR.10: "R%(10); 290 FOR C%=5% TO 32% STEP 9% 300 ; CUR(15,C%)" xt "CUR(16,C%)"~}" 310 ; CUR(17,C%)""CUR(18,C%)'!"' 320 NEXT C% 330 REM  UTSEENDE P] FIGURERNA 340 DATA bg,(=,j{,hm,jn,jo 350 DATA ;1,n$,w5,>4,=5,?5 360 DATA ;g,n=,w{,>m,=n,?o 380 RESTORE 360 390 FOR C%=1% TO 6% 400 READ A$ 410 FOR C1%=2% TO 32% STEP 3% 420 ; CUR((C%-1%)*2%+(S%-1%),C1%)A$" " 430 NEXT C1% : IF C%>1% ; CUR((C%-1%)*2%+(S%-1%)-1%,1%)SPACE$(39); 440 NEXT C% 450 ; CUR(20,2)"x}0" 457 REM  S%= Sv}righetsgrad 458 REM  |kas med 1 varje g}ng alla 459 REM  alla Invaderna nedskjutna 460 REM  AVD 3  470 REM  PAUS-VARIABLER  (Kan {ndras) 480 REM  Ju l{gre -- ju snabbare 490 P1%=30% : REM  Invaders 500 P2%=2% : REM  Invader-skott 510 P3%=0% : REM  Mitt skott 520 P4%=5% : REM  Kanonen 530 P5%=7% : REM  Super Invadern 540 REM  PAUS-MSP  (B|r ej {ndras) 550 POKE 61113%,175%,0% : REM  ( I)  560 POKE 60173%,200%,0% : REM  (IS)  570 POKE 60001%,50%,0% : REM  ( S)  580 POKE 61433%,50%,0% : REM  ( K)  590 POKE 60773%,25%,0% : REM  (SI)  600 REM  RND-RUTINER MSP  604 REM  [ndras endast efter REN 605 REM  Var i BASIC {r RND-rutinen 610 POKE 60810%,80%,0% : REM  (SI)  620 POKE 60227%,80%,0% : REM  (IS)  630 REM  INVADER-SKOTT FREKVENS  634 REM  Kan {ndras 635 REM  Ju l{gre -- ju oftare 636 REM  skjuter Invaderna 640 POKE 60185%,150%-9%*S% 650 REM  SKOTT-HASTIGHET  654 REM  Kan {ndras 655 REM  Ju h|gre -- ju fortare 660 POKE 60143%,2% 670 REM  I-SKOTT SKOTT-AREA-BREDD  674 REM  Kan {ndras 675 REM  Invadernas 'sikt'-omr}de 676 REM  60253 --- v{nster 677 REM  60271 --- h|ger 680 POKE 60253%,4% 690 POKE 60271%,8% 695 REM  Skall ej {ndras 710 POKE 61700%,-1%+S%,1%,34%,6%,1%,0%,3%,1%,1%,P1%,P1%,66%,0% 730 POKE 61720%,P2%,P2% 740 FOR C=61722 TO 61752 750 POKE C,0% : NEXT C 770 POKE 61780%,0%,0%,0%,0%,P3%,P3% 790 POKE 61800%,P4%,P4%,4% 810 POKE 61820%,P5%,P5%,0%,0%,0%,0%,0% 820 REM 840 RESTORE 340 850 FOR C%=1% TO 3% 860 FOR C1%=1% TO 6% 870 READ A$ 880 A=(241%+C%)*256%+(C1%-1%)*34% 890 POKE A,32% 900 FOR C2=A+1% TO A+31% STEP 3% 910 POKE C2,ASC(A$),ASC(RIGHT$(A$,2)),32% 920 NEXT C2 : NEXT C1% : NEXT C% 940 U%=CALL(61650%) 1040 ON U% GOTO 1040,1040,1060,1760,2220 1060 POKE 61780%,0%,0% 1070 R%=PEEK(61782%) : K%=PEEK(61783%) 1080 CLRDOT R%+1%,K% : CLRDOT R%+2%,K% 1090 CLRDOT R%+3%,K% 1100 REM 1110 FOR C=61722 TO 61731 1120 IF PEEK(C)=0 THEN 1140 1130 IF R%=PEEK(C+10) AND K%=PEEK(C+20) THEN 1670 1140 NEXT C : R%=R%/3% : K%=K%/2% 1150 IF R%PEEK(61700%)+PEEK(61703%)*2%-2% THEN 1720 1170 IF K%PEEK(61701%)+PEEK(61702%)-1% THEN 1720 1190 R%=R%*3% : K%=K%*2% 1220 OUT 6%,201% 1230 R1%=PEEK(61700%) : K1%=PEEK(61701%) 1240 ; CUR(R%/3%,K%/2%-1%)"991" 1250 A%=(K%/2%-K1%)/3% : REM 0-5 1260 A1%=(R%/3%-(R1%-1%))/2% : REM 0-10 1270 A2%=A1%*34%+A%*3%+1%+PEEK(61712%)*3% 1280 FOR C%=242% TO 244% 1290 POKE C%*256%+A2%,32%,32% 1300 NEXT C% 1310 P=P+(6%-A1%)*10% 1320 GOSUB 1340 : GOTO 1380 1340 IF B%=5% THEN 1360 1350 IF P>=B%(B%) THEN K=K+1 : B%=B%+1% 1360 ; CUR(22,7)P;CUR(23,9)K; : RETURN 1370 REM 1380 ; CUR(R%/3%,K%/2%-1%)" " 1390 OUT 6,0 1400 POKE 61711%,PEEK(61711%)-1% 1410 IF PEEK(61711%)=0% THEN 2200 1420 RESTORE 1430 1424 REM  1430 --- Kan {ndras 1425 REM  talpar (invaders kvar, 1426 REM  ggr innan nedflytt) 1427 REM  {ndra {ven antal talpar 1428 REM  rad 1460 1430 DATA 20,1 1434 REM  1440 --- Kan {ndras 1435 REM  talpar (invaders kvar, 1436 REM  hastighet) 1437 REM  Ju l{gre -- ju snabbare 1438 REM  {ndra {ven antal talpar 1439 REM  rad 1500 1440 DATA 60,27,50,23,40,18,30,15,20,12,10,8,7,6,5,5,4,4,3,2,2,1,1,0 1450 REM 1460 FOR C%=1% TO 1% 1470 READ A%,A1% 1480 IF PEEK(61711%)<=A% THEN POKE 61707%,A1% 1490 NEXT C% 1500 FOR C%=1% TO 12% 1510 READ A%,A1% 1520 IF PEEK(61711%)<=A% THEN POKE 61709%,A1% 1530 NEXT C% 1540 GOTO 2390 1560 OUT 6,5 1570 P1%=(FIX(RND*3%)+1%)*100% 1580 K%=PEEK(61826%) 1590 ; CUR(0,K%-1%)CHR$(135)RIGHT$(NUM$(P1%),2%) 1600 ; CUR(1,K%)" " 1610 FOR C=0 TO 500 : OUT 6,5 : NEXT C 1620 ; CUR(0,0)CHR$(151)SPACE$(39); 1630 POKE 61822%,0% 1640 P=P+P1% : GOSUB 1340 1650 GOTO 940 1670 OUT 6%,137% 1680 POKE C,0% 1690 CLRDOT PEEK(C+10)-1%,PEEK(C+20) : CLRDOT PEEK(C+10),PEEK(C+20) 1700 GOTO 940 1720 OUT 6%,137% : R%=PEEK(61782%) : K%=PEEK(61783%) : CLRDOT R%-1%,K% 1730 CLRDOT R%,K%-1% : CLRDOT R%,K%+1% : CLRDOT R%,K% 1740 GOTO 940 1760 A%=PEEK(61850%) 1770 R%=PEEK(61731%+A%) : K%=PEEK(61741%+A%) 1780 IF PEEK(61780%)=0% THEN 1830 1790 IF R%<>PEEK(61782%) OR K%<>PEEK(61783%) THEN 1830 1800 OUT 6%,137% : FOR C%=R%-2% TO R%+2% 1810 CLRDOT C%,K% : NEXT C% : POKE 61780%,0%,0% : POKE 61721+A%,0% 1820 GOTO 940 1830 IF R%/3%62% THEN 2130 1870 IF R%<60% THEN 2160 1900 K%=PEEK(61802%)/2% 1910 IF PEEK(61741+A%)PEEK(61802)+4% THEN 2160 1930 FOR C%=K% TO K%+3% 1940 POKE 32336%+C%,PEEK(32336%+C%)+128% 1950 NEXT C% 1960 FOR C=0 TO 1000 : OUT 6%,9% : NEXT C 1970 ; CUR(20,K%)" " : OUT 6%,0% 1980 K=K-1 : IF K=0 THEN 2220 1990 GOSUB 1340 2000 FOR C=61722 TO 61731 2010 IF PEEK(C)=0 THEN 2040 2020 POKE C,0% 2030 CLRDOT PEEK(C+10),PEEK(C+20) : CLRDOT PEEK(C+10)-1%,PEEK(C+20) 2040 NEXT C 2050 IF PEEK(61780%)=0% THEN 2090 2060 R%=PEEK(61782%) : K%=PEEK(61783%) 2070 POKE 61780%,0%,0% 2080 CLRDOT R%,K% : CLRDOT R%+1%,K% : CLRDOT R%+2%,K% 2090 POKE 61802%,4% 2100 ; CUR(20,2)"x}0" 2110 GOTO 940 2130 ; CUR(21,1)STRING$(39,35); 2140 GOTO 940 2160 OUT 6,137 : CLRDOT R%+1%,K% 2170 CLRDOT R%,K%-1% : CLRDOT R%,K%+1% : CLRDOT R%,K% 2180 GOTO 940 2200 S%=S%+1% : GOTO 220 2220 ; CUR(2,16)"GAME OVER" 2230 POKE 65013,0 : OUT 6,0 2240 FOR A=0 TO 25000 2250 IF PEEK(65013) THEN 2270 2260 NEXT A 2270 POKE 65013,0 2280 ; CHR$(12)"Din po{ng:"P : ; : ; 2290 ; "***** DAGENS TIO-I-TOPP *****" : ; 2300 GOTO 2650 2310 POKE 65013,0 2320 ; : ; "En g}ng till (J/N) "; 2330 INPUT A$ 2340 A$=CHR$(ASC(A$)) 2350 IF A$<>"N" AND A$<>"n" THEN 140 2360 END 2390 T%=PEEK(61703%) : B1%=PEEK(61702%) 2400 R%=PEEK(61700%) : K%=PEEK(61701%) 2410 B2%=PEEK(61712%) 2420 FOR C%=1% TO T% 2430 A=61952%+(C%-1%)*34%+B1%-2%+B2%*3% 2440 IF PEEK(A)<>32% THEN 2480 2450 NEXT C% : POKE 61702%,B1%-3% 2460 B1%=B1%-3% : GOTO 2420 2480 FOR C%=1% TO T% 2490 A=61952%+(C%-1%)*34%+B2%*3%+1% 2500 IF PEEK(A)<>32% THEN 2540 2510 NEXT C% : POKE 61712%,B2%+1% 2520 B2%=B2%+1% : POKE 61701%,K%+3% : K%=K%+3% : POKE 61702%,B1%-3% : B1%=B1%-3% : GOTO 2480 2540 FOR C%=1% TO 31% STEP 3% 2550 A=61952%+(T%-1%)*34%+C% 2560 IF PEEK(A)<>32% THEN 2590 2570 NEXT C% : POKE 61703%,T%-1% 2580 T%=T%-1% : GOTO 2540 2590 GOTO 940 2600 DIM R$(10)=3,R%(10) 2610 FOR C%=1% TO 10% 2620 R$(C%)="___" : R%(C%)=0% 2630 NEXT C% : RETURN 2650 C1%=0% 2660 FOR C%=1% TO 10% 2670 IF C1% 2690 2680 IF P>R%(C%) THEN 2720 2690 ; C%;TAB(10)R%(C%);TAB(20)R$(C%) 2700 NEXT C% 2710 GOTO 2770 2720 ; ">"RIGHT$(NUM$(C%),2%)TAB(10)P : R=PEEK(65011)-1 : C2%=C% 2730 FOR C3%=10% TO C%+1% STEP -1% 2740 R$(C3%)=R$(C3%-1%) : R%(C3%)=R%(C3%-1%) 2750 NEXT C3% 2760 C1%=1% : GOTO 2700 2770 IF C1%<>1% THEN 2320 2780 ; CUR(R,19); : INPUT A$ 2790 R$(C2%)=LEFT$(A$+" ",3) : R%(C2%)=P 2800 ; CHR$(12)"Din po{ng:"P : ; : ; 2810 ; "***** DAGENS TIO-I-TOPP *****" : ; 2820 C1%=2% : GOTO 2660 2840 ; CHR$(12)"- SUPER INVADER -" : ; 2850 ; "Det v{lk{nda pub-spelet Space-invaders. Nu p} {ven p} ABC80." 2860 ; : ; "Det hela g}r ut p} att skjuta ned s} m}nga 'Invaders' som m|jligt innan man sj{lv blir nedskjuten." 2870 ; : ; "Du styr med :" 2880 ; TAB(15)"Q -- V{nster" : ; TAB(15)"W -- H|ger" 2890 ; : ; "Du skjuter med RETURN" 2900 ; : ; "Skjuter du ned en Super-Invader l{ggs den po{ng som skrivs ut, till din." 2910 ; : ; "Du har 3 kanoner fr}n b|rjan" 2920 ; : ; "En bonus kanon erh}lls vid 4000,7000, 10000 och 15000 po{ng." 2930 FOR A=0 TO 1000 : NEXT A 2940 ; : ; TAB(10)"Tryck p} RETURN "CHR$(9,9,8); 2950 GET A$ : IF A$<>CHR$(13) THEN 2950 2960 RETURN