atom_sss.tap
atom_sss.z80
Zeichensatz UTF-8+Z1013()+CTRL()-ohne Umlaute(äöüß)

   10!    Frank Boettcher
   20!    Ludwig-Renn-Str. 48
   30!    Berlin, 1142
   40!
   50!    IDEE: J. Goering
   60!    "Labyrinth der Denkspiele"
   70!    Verlag Neues Leben, Berlin 1987
   80!
   90 POKE-4152,48:CLS
  100 DIM D(36)
  110 DIM E(32)
  120 DIM F(9,9):DIM G(26,29)
  130 FA$=STRING$(2,"FALSCH ")
  140 RI$=STRING$(2,"RICHTIG ")
  150 UE$=" WO SIND DIE ATOME?   ? ?  "
  160 S1$=STRING$(8,""):S2$=S1$+""
  170 UF$="                           "
  180 UG$=" DAS GROSSE ATOMFORSCHER-SPIEL "
  190 X=10:Y=5
  200 S4$="ABCDEFGH"
  210 FOR I=1 TO 8
  220 E(I)=I
  230 NEXT
  240 H1=8
  250 FOR I=19 TO 89 STEP 10
  260 H1=H1+1
  270 E(H1)=I 
  280 NEXT
  290 FOR I=98 TO 91 STEP-1
  300 H1=H1+1
  310 E(H1)=I
  320 NEXT
  330 FOR I=80 TO 10 STEP-10
  340 H1=H1+1
  350 E(H1)=I
  360 NEXT
  370 GOSUB 3400
  380 PRINT AT(10,7);"Bedieungsanleitung? (J/N)"
  390 L2$=INKEY$:IF L2$=""THEN 390
  400 IF L2$="J" THEN GOTO 3990
  410 PRINT AT(10,7);STRING$(30," ")
  420 A1$=""
  430 GOSUB 660
  440 GOSUB 3130
  450 GOSUB 2560
  460 L2$=INKEY$:IF L2$=""THEN 460
  470 TE=ASC(L2$)
  480 IF TE>48 THEN VE=1:ELSE IF TE=13 THEN VE=3:ELSE VE=2
  490 ON VE GOSUB 830,1310,2090
  500 PRINT AT(2,33);ZA
  510 IF EK<>1 THEN 460
  520 GOSUB 3190
  530 PRINT AT(23,31);">>ENTER<<"
  540 L2$=INKEY$:IF L2$=""THEN 540
  550 CLS
  560 PRINT AT(0,0);UG$
  570 PRINT AT(10,7);"Nochmal? (J/N)"
  580 L2$=INKEY$:IF L2$=""THEN 580
  590 IF L2$<>"N" THEN 410
  600 OUT 136,128
  610 OUT 128,39:OUT 128,18
  620 PAUSE 10:OUT 128,3
  630 OUT 136,0
  640 CLS:POKE-4152,16
  650 END
  660!
  670 PRINT AT(2,26);"MOMENT!"
  680 FOR I= 1 TO 36
  690 D(I)=0
  700 NEXT
  710 FOR I=1 TO 8
  720 FOR K=1 TO 8
  730 F(I,K)=0
  740 NEXT K,I
  750 FOR I= 0 TO 26
  760 FOR K=0 TO 29
  770 G(I,K)=0
  780 NEXT K,I
  790 SN=0:ZA=0:P=1
  800 A(1)=0:A(2)=0:A(3)=0:A(4)=0
  810 H3=0:EK=0
  820 RETURN
  830!
  840 IF TE>56 AND TE<65 THEN RETURN
  850 IF TE>72 THEN RETURN
  860 IF TE<65 THEN H5=H5+1:EZ=TE-48:ELSE H6=H6+1:ES=TE-64
  870 IF ES=0 THEN ES=-16
  880 PRINT AT(0,29);CHR$(ES+64),EZ
  890 IF H5=0 OR H6=0 THEN RETURN   
  900 H5=0:H6=0
  910 IF F(EZ,ES)=1 THEN 1080
  920 ES=0:EZ=0
  930 FOR I=0 TO 5
  940 PRINT AT(0,I);" "
  950 NEXT
  960 FOR I=3 TO 15 
  970 PRINT AT(0,2*I);" "+MID$(FA$,I-2,1)
  980 NEXT
  990 FOR I=32 TO 39
 1000 PRINT AT(0,I);" "
 1010 NEXT
 1020 PAUSE 7:BEEP
 1030 FOR I=0 TO 39
 1040 PRINT AT(0,I);MID$(UE$,I+1,1)
 1050 NEXT
 1060 ZA=ZA+5
 1070 RETURN
 1080 FOR I=1 TO 4
 1090 IF A(I)=10*EZ+ES THEN I=5
 1100 IF A(I)=0 THEN A(I)=10*EZ+ES:I=5
 1110 NEXT
 1120 IF A(1)>0 AND A(2)>0 AND A(3)>0 AND A(4)>0 THEN EK=1
 1130 PRINT AT(Y+2+EZ,X+2+ES);"*"
 1140 FOR I=0 TO 1
 1150 PRINT AT(0,I);" "
 1160 NEXT
 1170 FOR I=1 TO 16
 1180 PRINT AT(0,2*I);" "+MID$(RI$,I,1)
 1190 NEXT
 1200 FOR I=33 TO 39
 1210 PRINT AT(0,I);" "
 1220 NEXT
 1230 PAUSE 7:BEEP
 1240 IF EK<>1 THEN L3$=UE$:ELSE L3$=UF$
 1250 FOR I=0 TO 39
 1260 PRINT AT(0,I);MID$(L3$,I+1,1)
 1270 NEXT
 1280 AZ=AZ-4
 1290 ES=0:EZ=0
 1300 RETURN
 1310!
 1320 IF TE<>32 THEN RETURN
 1330 P=P+1:IF P>32 THEN P=1
 1340 ON P GOTO 1360,1380,1400,1420,1440,1460,1480,1500,1520,1540,1560,1580
 1350 GOTO 1600
 1360 PRINT AT(Y+3,X+1);"1":PRINT AT(Y+1,X+3);""
 1370 RETURN
 1380 PRINT AT(Y+1,X+3);"A":PRINT AT(Y+1,X+4);""
 1390 RETURN
 1400 PRINT AT(Y+1,X+4);"B":PRINT AT(Y+1,X+5);""
 1410 RETURN
 1420 PRINT AT(Y+1,X+5);"C":PRINT AT(Y+1,X+6);""
 1430 RETURN
 1440 PRINT AT(Y+1,X+6);"D":PRINT AT(Y+1,X+7);""
 1450 RETURN
 1460 PRINT AT(Y+1,X+7);"E":PRINT AT(Y+1,X+8);""
 1470 RETURN
 1480 PRINT AT(Y+1,X+8);"F":PRINT AT(Y+1,X+9);""
 1490 RETURN
 1500 PRINT AT(Y+1,X+9);"G":PRINT AT(Y+1,X+10);""
 1510 RETURN
 1520 PRINT AT(Y+1,X+10);"H":PRINT AT(Y+3,X+12);""
 1530 RETURN
 1540 PRINT AT(Y+3,X+12);"1":PRINT AT(Y+4,X+12);""
 1550 RETURN
 1560 PRINT AT(Y+4,X+12);"2":PRINT AT(Y+5,X+12);""
 1570 RETURN
 1580 PRINT AT(Y+5,X+12);"3":PRINT AT(Y+6,X+12);""
 1590 RETURN
 1600!
 1610 H=P-12
 1620 ON H GOTO 1640,1660,1680,1700,1720,1740,1760,1780,1800,1820,1840,1860
 1630 GOTO 1880
 1640 PRINT AT(Y+6,X+12);"4":PRINT AT(Y+7,X+12);""
 1650 RETURN
 1660 PRINT AT(Y+7,X+12);"5":PRINT AT(Y+8,X+12);""
 1670 RETURN
 1680 PRINT AT(Y+8,X+12);"6":PRINT AT(Y+9,X+12);""
 1690 RETURN
 1700 PRINT AT(Y+9,X+12);"7":PRINT AT(Y+10,X+12);"" 
 1710 RETURN
 1720 PRINT AT(Y+10,X+12);"8":PRINT AT(Y+12,X+10);""
 1730 RETURN
 1740 PRINT AT(Y+12,X+10);"H":PRINT AT(Y+12,X+9);""
 1750 RETURN
 1760 PRINT AT(Y+12,X+9);"G":PRINT AT(Y+12,X+8);""
 1770 RETURN
 1780 PRINT AT(Y+12,X+8);"F":PRINT AT(Y+12,X+7);""
 1790 RETURN
 1800 PRINT AT(Y+12,X+7);"E":PRINT AT(Y+12,X+6);""
 1810 RETURN
 1820 PRINT AT(Y+12,X+6);"D":PRINT AT(Y+12,X+5);""
 1830 RETURN
 1840 PRINT AT(Y+12,X+5);"C":PRINT AT(Y+12,X+4);""
 1850 RETURN
 1860 PRINT AT(Y+12,X+4);"B":PRINT AT(Y+12,X+3);""
 1870 RETURN
 1880 H=P-24
 1890 ON H GOTO 1910,1930,1950,1970,1990,2010,2030,2050,2070
 1900!
 1910 PRINT AT(Y+12,X+3);"A":PRINT AT(Y+10,X+1);""
 1920 RETURN
 1930 PRINT AT(Y+10,X+1);"8":PRINT AT(Y+9,X+1);""
 1940 RETURN
 1950 PRINT AT(Y+9,X+1);"7":PRINT AT(Y+8,X+1);""
 1960 RETURN
 1970 PRINT AT(Y+8,X+1);"6":PRINT AT(Y+7,X+1);""
 1980 RETURN
 1990 PRINT AT(Y+7,X+1);"5":PRINT AT(Y+6,X+1);""
 2000 RETURN
 2010 PRINT AT(Y+6,X+1);"4":PRINT AT(Y+5,X+1);""
 2020 RETURN
 2030 PRINT AT(Y+5,X+1);"3":PRINT AT(Y+4,X+1);""
 2040 RETURN
 2050 PRINT AT(Y+4,X+1);"2":PRINT AT(Y+3,X+1);""
 2060 RETURN
 2070 PRINT AT(Y+4,X+1);"1":PRINT AT(Y+1,X+3);""
 2080 RETURN
 2090!
 2100 IF D(P)=1 THEN RETURN
 2110 D(P)=1
 2120 SN=SN+1:ZA=ZA+1:H9=0
 2130 Z=INT(E(P)/10)
 2140 S=E(P)-Z*10
 2150 IF P<9 THEN BW=4
 2160 IF P>8 AND P<17 THEN BW=3
 2170 IF P>16 AND P<25 THEN BW=1
 2180 IF P>24 THEN BW=2
 2190 GOSUB 2760
 2200 GOSUB 3080
 2210 ON BW GOSUB 2240,2320,2400,2480
 2220 IF Z=0 OR Z=9 OR S=0 OR S=9 OR AB=1 THEN PAUSE 10:GOSUB 2990:RETURN
 2230 GOTO 2200
 2240!
 2250 Z=Z-1:IF Z=0 THEN RETURN
 2260 IF F(Z,S)=1 THEN AB=1:RETURN
 2270 RE=F(Z,S-1)+F(Z,S+1)+F(Z-1,S-1)+F(Z-1,S)+F(Z-1,S+1)
 2280 IF RE>1 THEN Z=9:RETURN
 2290 IF F(Z,S-1)=1 OR F(Z-1,S-1)=1 THEN BW=2:RETURN
 2300 IF F(Z,S+1)=1 OR F(Z-1,S+1)=1 THEN BW=3
 2310 RETURN
 2320!
 2330 S=S+1:IF S=9 THEN RETURN
 2340 IF F(Z,S)=1 THEN AB=1:RETURN
 2350 RE=F(Z-1,S)+F(Z+1,S)+F(Z-1,S+1)+F(Z,S+1)+F(Z+1,S+1)
 2360 IF RE>1 THEN S=0:RETURN
 2370 IF F(Z-1,S)=1 OR F(Z-1,S+1)=1 THEN BW=4:RETURN
 2380 IF F(Z+1,S)=1 OR F(Z+1,S+1)=1 THEN BW=1
 2390 RETURN
 2400!
 2410 S=S-1:IF S=0 THEN RETURN
 2420 IF F(Z,S)=1 THEN AB=1:RETURN
 2430 RE=F(Z-1,S)+F(Z+1,S)+F(Z-1,S-1)+F(Z,S-1)+F(Z+1,S-1)
 2440 IF RE>1 THEN S=9:RETURN
 2450 IF F(Z-1,S)=1 OR F(Z-1,S-1)=1 THEN BW=4:RETURN
 2460 IF F(Z+1,S)=1 OR F(Z+1,S-1)=1 THEN BW=1
 2470 RETURN
 2480!
 2490 Z=Z+1:IF Z=9 THEN RETURN
 2500 IF F(Z,S)=1 THEN AB=1:RETURN
 2510 RE=F(Z,S-1)+F(Z,S+1)+F(Z+1,S-1)+F(Z+1,S)+F(Z+1,S+1)
 2520 IF RE>1 THEN Z=0:RETURN
 2530 IF F(Z,S-1)=1 OR F(Z+1,S-1)=1 THEN BW=2:RETURN
 2540 IF F(Z,S+1)=1 OR F(Z+1,S+1)=1 THEN BW=3
 2550 RETURN
 2560!
 2570 PRINT AT(Y,X);"",S2$,""
 2580 PRINT AT(Y+1,X);"  ",S4$:PRINT AT(Y+1,X+13);""
 2590 PRINT AT(Y+1,X+3);""
 2600 PRINT AT(Y+2,X);" ",S1$," "
 2610 FOR I=1 TO 8
 2620 PRINT AT(Y+2+I,X);"",CHR$(48+I),""
 2630 PRINT AT(Y+2+I,X+11);"",CHR$(48+I),""
 2640 NEXT
 2650 PRINT AT(Y+11,X);" ",S1$," "
 2660 PRINT AT(Y+12,X);"  ",S4$:PRINT AT(Y+12,X+13);""
 2670 PRINT AT(Y+13,X);"",S2$,""
 2680 FOR I=3 TO 10
 2690 FOR K=3 TO 10
 2700 IF F(I-2,K-2)=1 THEN PRINT AT(Y+I,X+K);A1$:ELSE PRINT AT(Y+I,X+K);""
 2710 NEXT K,I
 2720 PRINT AT(0,0);UE$
 2730 PRINT AT(2,26);"PUNKTE: 0"
 2740!
 2750 RETURN
 2760!
 2770 ON BW GOSUB 2790,2840,2890,2940
 2780 RETURN
 2790 EY=Y+14
 2800 EX=X+2+S
 2810 PRINT AT(EY,EX);""
 2820 PRINT AT(EY+1,EX);CHR$(64+SN)
 2830 RETURN
 2840 EY=Y+2+Z
 2850 EX=X-1
 2860 PRINT AT(EY,EX);""
 2870 PRINT AT(EY,EX-1);CHR$(64+SN)
 2880 RETURN
 2890 EY=Y+2+Z
 2900 EX=X+14
 2910 PRINT AT(EY,EX);""
 2920 PRINT AT(EY,EX+1);CHR$(64+SN)
 2930 RETURN
 2940 EY=Y-1
 2950 EX=X+2+S
 2960 PRINT AT(EY,EX);""
 2970 PRINT AT(EY-1,EX);CHR$(64+SN)
 2980 RETURN
 2990!
 3000 IF AB=1 THEN PRINT AT(EY,EX);"":AB=0:RETURN
 3010 IF RE>1 THEN PRINT AT(EY,EX);"":RETURN
 3020 IF Z=0 THEN PRINT AT(Y-4,X+2+S);"":PRINT AT(Y-3,X+2+S);CHR$(64+SN):RETURN
 3030 IF S=9 THEN PRINT AT(Y+2+Z,X+17);"":PRINT AT(Y+2+Z,X+16);CHR$(64+SN)
 3040 IF Z=9 THEN PRINT AT(Y+17,X+2+S);"":PRINT AT(Y+16,X+2+S);CHR$(64+SN):RETURN
 3050 IF S=0 THEN PRINT AT(Y+2+Z,X-4);"":PRINT AT(Y+2+Z,X-3);CHR$(64+SN):RETURN
 3060 RETURN
 3070!
 3080!
 3090 H9=H9+1
 3100 G(SN,H9)=10*Z+S
 3110 RETURN
 3120!
 3130!
 3140 Z=1+INT(8*RND(1))
 3150 S=1+INT(8*RND(1))
 3160 IF F(Z,S)=1 THEN GOTO 3140:ELSE F(Z,S)=1
 3170 H3=H3+1
 3180 IF H3>3 THEN RETURN:ELSE GOTO 3140
 3190!
 3200 BEEP
 3210 PRINT AT(0,3);" HIER DIE AUFLOESUNG"
 3220 PRINT AT(0,29);"   "
 3230 FOR I=1 TO SN
 3240 L1$="":M1=0
 3250 GOSUB 3320
 3260 PAUSE 15
 3270 L1$="":M1=0
 3280 GOSUB 3320
 3290 PAUSE 5
 3300 NEXT I
 3310 RETURN 
 3320 BEEP
 3330 FOR K=2 TO 29
 3340 Z=INT(G(I,K)/10)
 3350 S=G(I,K)-Z*10
 3360 IF Z=0 OR S=0 THEN M1=1:K=29
 3370 IF M1=0 THEN PRINT AT(Z+Y+2,S+X+2);L1$ 
 3380 NEXT K
 3390 RETURN
 3400!**** ANFANGSBILD ******
 3410 CLS
 3420 OUT 136,128
 3430 PRINT UG$
 3440 FOR L=1 TO 2
 3450 PRINT AT(20,31);""
 3460 PRINT AT(21,31);""
 3470 PAUSE 6
 3480 FOR I=3 TO 15
 3490 PRINT AT(4,I);""
 3500 FOR K=1 TO 5:NEXT K
 3510 OUT 128,7
 3520 OUT 128,60-I
 3530 OUT 128,3
 3540 NEXT I
 3550 FOR I=5 TO 20
 3560 PRINT AT(I,15);""
 3570 FOR K=1 TO 5:NEXT K 
 3580 OUT 128,7
 3590 OUT 128,50-I
 3600 OUT 128,3
 3610 NEXT I
 3620 FOR I=16 TO 30
 3630 PRINT AT(20,I);""
 3640 FOR K=1 TO 5:NEXT K
 3650 OUT 128,7
 3660 OUT 128,46-I
 3670 OUT 128,3
 3680 NEXT I
 3690 PRINT AT(20,31);""
 3700 PRINT AT(21,31);""
 3710 PAUSE 1
 3720 PRINT AT(19,30);""
 3730 PRINT AT(20,33);""
 3740 PRINT AT(22,31);""
 3750 FOR I=8 TO 40
 3760 OUT 128,7
 3770 OUT 128,I
 3780 OUT 128,3
 3790 NEXT I
 3800 PRINT AT(20,32);" "
 3810 PRINT AT(21,31);"  "
 3820 PAUSE 1
 3830 PRINT AT(19,30);"    "
 3840 PRINT AT(20,31);"   "
 3850 PRINT AT(21,30);"    "
 3860 PRINT AT(22,30);"     "
 3870 PAUSE 3
 3880 PRINT AT(4,3);STRING$(13," ")
 3890 WINDOW 4,21,15,15
 3900 PRINT STRING$(17," ")
 3910 WINDOW
 3920 PRINT AT(20,16);STRING$(15," ")
 3930 NEXT L
 3940 OUT 128,39:OUT 128,18
 3950 PAUSE 10
 3960 OUT 128,3
 3970 OUT 136,0
 3980 RETURN
 3990! *** TEXT ***
 4000 PRINT AT(4,3);"Sie haben die Aufgabe, die in der"
 4010 PRINT AT(6,3);"Nebelkammer versteckten 4 Atome zu"
 4020 PRINT AT(8,3);"finden.
 4030 PRINT AT(10,3);"Dazu koennen Sie mit einem    "
 4040 PRINT AT(12,3);"Strahler '' in die Kammer leuchten."
 4050 PRINT AT(14,3);"Am Rand der Kammer wird das"
 4060 PRINT AT(16,3);"Verhalten des Strahls durch Zeichen"
 4070 PRINT AT(18,3);"markiert."
 4080 PRINT AT(23,30);">>ENTER<<"
 4090 L2$=INKEY$:IF L2$=""THEN 4090
 4100 PRINT AT(4,3);"Die Zeichen haben folgende Bedeutung:"
 4110 PRINT AT(6,3);STRING$(34," ")
 4120 PRINT AT(8,3);" oder  = Eintritts- oder Austritts-"
 4130 PRINT AT(10,3);"           punkt eines Strahls"
 4140 PRINT AT(12,3);"        = reflektierter Strahl     "
 4150 PRINT AT(14,3);"        = absorbierter Strahl"
 4160 PRINT AT(16,3);STRING$(35," ")
 4170 PRINT AT(18,3);STRING$(30," ")
 4180 L2$=INKEY$:IF L2$=""THEN 4180
 4190 PRINT AT(4,3);"So geht der Strahl durch die Kammer: "
 4200 PRINT AT(6,3);"1. Trifft er auf ein einzelnes Atom,"
 4210 PRINT AT(8,3);"   so wird er absorbiert.    ()       "
 4220 PRINT AT(10,3);"2. Trifft er auf ein Feld, das mehr "
 4230 PRINT AT(12,3);"   als ein Atom zum Nachbarn hat,    "
 4240 PRINT AT(14,3);"   wird er reflektiert.      ()       "
 4250 PRINT AT(16,3);"3. Bei nur einem benachbarten Atom "
 4260 PRINT AT(18,3);"   wird der Strahl um 90 Grad abge-"
 4270 PRINT AT(20,3);"   lenkt. Sonst geht er glatt durch."
 4280 L2$=INKEY$:IF L2$=""THEN 4280
 4290 PRINT AT(4,3);"Den Strahler bewegen Sie mit 'SPACE'."
 4300 PRINT AT(6,3);"Ausloesen koennen Sie mit 'ENTER'.   "
 4310 PRINT AT(8,3);"Dabei erhaelt der Strahl einen Buch-"
 4320 PRINT AT(10,3);"staben als Kennzeichen.            "
 4330 PRINT AT(12,3);"Jeder Schuss kostet einen Punkt.   "
 4340 PRINT AT(14,3);"Glauben Sie, ein Atom entdeckt zu  "
 4350 PRINT AT(16,3);"haben, dann geben Sie die Koordinaten"
 4360 PRINT AT(18,3);"ein. Fehler kosten 5 Punkte. Ein    "
 4370 PRINT AT(20,3);"Treffer macht das Atom sichtbar.      "
 4380 L2$=INKEY$:IF L2$=""THEN 4380
 4390 FOR I=4 TO 22 STEP 2
 4400 PRINT AT(I,3);STRING$(37," ")
 4410 NEXT
 4420 PRINT AT(23,30);"         "
 4430 OUT 136,128:OUT 128,39:OUT 128,18
 4440 PAUSE 10
 4450 OUT 128,3
 4460 PRINT AT(11,11);"Hier ein Beispiel:"
 4470 PAUSE 20
 4480 PRINT AT(11,11);"                  "
 4490 GOSUB 660
 4500 F(6,1)=1:F(4,6)=1
 4510 F(5,6)=1:F(6,5)=1
 4520 A1$="*"
 4530 GOSUB 2560
 4540 PRINT AT(2,26);" BEISPIEL  "
 4550 PAUSE 10
 4560 TE=32
 4570 GOSUB 2090:PAUSE 5:GOSUB 1310
 4580 PAUSE 10
 4590 GOSUB 1310:PAUSE 3:GOSUB 1310
 4600 PAUSE 5:GOSUB 2090
 4610 PAUSE 10
 4620 FOR I=1 TO 6
 4630 GOSUB 1310:PAUSE 3
 4640 NEXT
 4650 PAUSE 5:GOSUB 2090
 4660 PAUSE 10
 4670 GOSUB 1310:PAUSE 3:GOSUB 1310
 4680 PAUSE 5
 4690 GOSUB 2090
 4700 PAUSE 5
 4710 FOR I=1 TO 7
 4720 GOSUB 1310:PAUSE 3
 4730 NEXT
 4740 PAUSE 5
 4750 GOSUB 2090
 4760 PAUSE 10
 4770 OUT 128,39:OUT 128,18
 4780 PAUSE 10:OUT 128,3
 4790 OUT 136,0
 4800 GOSUB 3190
 4810 PRINT AT(23,31);">>ENTER<<"
 4820 L2$=INKEY$:IF L2$=""THEN 4820
 4830 CLS
 4840 PRINT AT(0,0);UG$
 4850 PRINT AT(10,7);"ACHTUNG! Es geht los!"
 4860 PAUSE 40
 4870 GOTO 410