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 >
Commodore BASIC  |  2023-02-26  |  1KB  |  80 lines

  1. 5 poke 53281,0:poke 53280,0
  2. 6 print:print:print:print:print
  3. 7 print:print:print:print:print
  4. 8 print:print:print:print:print
  5. 9 print:print:print:print:print
  6. 10 print:print:print:print:print
  7. 11 print:print:print:print:print
  8. 100 goto 10000
  9. 1000 rem ausdruck feld computer
  10. 1010 if x=1 then a$="c"
  11. 1020 if x=2 then b$="c"
  12. 1030 if x=3 then c$="c"
  13. 1040 if x=4 then f$="c"
  14. 1050 if x=5 then i$="c"
  15. 1060 if x=6 then h$="c"
  16. 1070 if x=7 then g$="c"
  17. 1080 if x=8 then d$="c"
  18. 1090 if x=9 then e$="c"
  19. 1500 rem ausdruck feld spieler
  20. 1510 if y=1 then a$="s"
  21. 1520 if y=2 then b$="s"
  22. 1530 if y=3 then c$="s"
  23. 1540 if y=4 then f$="s"
  24. 1550 if y=5 then i$="s"
  25. 1560 if y=6 then h$="s"
  26. 1570 if y=7 then g$="s"
  27. 1580 if y=8 then d$="s"
  28. 1590 if y=9 then e$="s"
  29. 1600 print:print a$;b$;c$
  30. 1601 print d$;e$;f$
  31. 1602 print g$;h$;i$:print
  32. 1610 return
  33. 2000 computerzug
  34. 2010 print "computer zieht";x
  35. 2020 return
  36. 2500 spielerzug
  37. 2510 input "dein zug";y
  38. 2520 return
  39. 3000 ausgabe computersieg
  40. 3010 print "der computer hat gewonnen."
  41. 3020 end
  42. 10000 def fnm(x)=x-8*int((x-1)/8)
  43. 10001 w=0
  44. 10010 a$="1":b$="2":c$="3":d$="8"
  45. 10020 e$="9":f$="4":g$="7":h$="6":i$="5"
  46. 10030 x=9
  47. 10040 gosub 2010
  48. 10050 gosub 1010
  49. 10060 gosub 2510
  50. 10070 o=y:g=fnm(o+1):x=g
  51. 10080 gosub 2010
  52. 10090 gosub 1010
  53. 10100 gosub 2510
  54. 10110 p=y
  55. 10120 if p=fnm(g+4) then b=fnm(g+2):x=b:pr=1
  56. 10130 if pr<>1 then b=fnm(g+4):x=b:w=1
  57. 10135 gosub 2010
  58. 10136 gosub 1010
  59. 10140 if w=1 then gosub 3010
  60. 10150 pr=0:w=0
  61. 10180 gosub 2510
  62. 10190 c=y
  63. 10200 if c=fnm(b+4) then pr2=1
  64. 10201 if pr2=1 and o/2 <> int (o/2) then pr2=5
  65. 10202 if pr2=0 then d=fnm(b+4):x=d:w=1
  66. 10203 if pr2=1 then d=fnm(b+7):x=d:w=1
  67. 10204 if pr2=5 then d=fnm(b+3):x=d
  68. 10210 gosub 2010
  69. 10215 gosub 1010
  70. 10220 if w=1 then gosub 3010
  71. 10225 pr2=0:w=0
  72. 10230 gosub 2510
  73. 10240 h=y
  74. 10250 if h=fnm(d+4) then k=fnm(d+6):x=k:pr3=1
  75. 10260 if pr3<>1 then k=fnm(d+4):x=k
  76. 10270 gosub 2010
  77. 10280 gosub 1010
  78. 10290 print:print "gluehstrumpf, remis !!!"
  79. 10300 end
  80.