home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tiger Disk 43
/
Tiger_Disk_043_1997-10_Tiger-Crew-Disk_de_Side_B.d64
/
minitictactoe
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
1KB
|
80 lines
5 poke 53281,0:poke 53280,0
6 print:print:print:print:print
7 print:print:print:print:print
8 print:print:print:print:print
9 print:print:print:print:print
10 print:print:print:print:print
11 print:print:print:print:print
100 goto 10000
1000 rem ausdruck feld computer
1010 if x=1 then a$="c"
1020 if x=2 then b$="c"
1030 if x=3 then c$="c"
1040 if x=4 then f$="c"
1050 if x=5 then i$="c"
1060 if x=6 then h$="c"
1070 if x=7 then g$="c"
1080 if x=8 then d$="c"
1090 if x=9 then e$="c"
1500 rem ausdruck feld spieler
1510 if y=1 then a$="s"
1520 if y=2 then b$="s"
1530 if y=3 then c$="s"
1540 if y=4 then f$="s"
1550 if y=5 then i$="s"
1560 if y=6 then h$="s"
1570 if y=7 then g$="s"
1580 if y=8 then d$="s"
1590 if y=9 then e$="s"
1600 print:print a$;b$;c$
1601 print d$;e$;f$
1602 print g$;h$;i$:print
1610 return
2000 computerzug
2010 print "computer zieht";x
2020 return
2500 spielerzug
2510 input "dein zug";y
2520 return
3000 ausgabe computersieg
3010 print "der computer hat gewonnen."
3020 end
10000 def fnm(x)=x-8*int((x-1)/8)
10001 w=0
10010 a$="1":b$="2":c$="3":d$="8"
10020 e$="9":f$="4":g$="7":h$="6":i$="5"
10030 x=9
10040 gosub 2010
10050 gosub 1010
10060 gosub 2510
10070 o=y:g=fnm(o+1):x=g
10080 gosub 2010
10090 gosub 1010
10100 gosub 2510
10110 p=y
10120 if p=fnm(g+4) then b=fnm(g+2):x=b:pr=1
10130 if pr<>1 then b=fnm(g+4):x=b:w=1
10135 gosub 2010
10136 gosub 1010
10140 if w=1 then gosub 3010
10150 pr=0:w=0
10180 gosub 2510
10190 c=y
10200 if c=fnm(b+4) then pr2=1
10201 if pr2=1 and o/2 <> int (o/2) then pr2=5
10202 if pr2=0 then d=fnm(b+4):x=d:w=1
10203 if pr2=1 then d=fnm(b+7):x=d:w=1
10204 if pr2=5 then d=fnm(b+3):x=d
10210 gosub 2010
10215 gosub 1010
10220 if w=1 then gosub 3010
10225 pr2=0:w=0
10230 gosub 2510
10240 h=y
10250 if h=fnm(d+4) then k=fnm(d+6):x=k:pr3=1
10260 if pr3<>1 then k=fnm(d+4):x=k
10270 gosub 2010
10280 gosub 1010
10290 print:print "gluehstrumpf, remis !!!"
10300 end