ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

115 lines
3.0 KiB

  1. 2 PRINT TAB(30);"TIC-TAC-TOE"
  2. 4 PRINT TAB(15);"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY"
  3. 6 PRINT:PRINT:PRINT
  4. 8 PRINT "THE BOARD IS NUMBERED:"
  5. 10 PRINT " 1 2 3"
  6. 12 PRINT " 4 5 6"
  7. 14 PRINT " 7 8 9"
  8. 16 PRINT:PRINT:PRINT
  9. 20 DIM SS(9)
  10. 50 INPUT"DO YOU WANT 'X' OR 'O'";C$
  11. 55 IF C$="X"THEN 475
  12. 60 P$="O":Q$="X"
  13. 100 G=-1:H=1:IF SS(5)<>0 THEN 103
  14. 102 SS(5)=-1:GOTO 195
  15. 103 IF SS(5)<>1 THEN 106
  16. 104 IF SS(1)<>0 THEN 110
  17. 105 SS(1)=-1:GOTO 195
  18. 106 IF SS(2)=1 AND SS(1)=0 THEN 181
  19. 107 IF SS(4)=1 AND SS(1)=0 THEN 181
  20. 108 IF SS(6)=1 AND SS(9)=0 THEN 189
  21. 109 IF SS(8)=1 AND SS(9)=0 THEN 189
  22. 110 IF G=1 THEN 112
  23. 111 GOTO 118
  24. 112 J=3*INT((M-1)/3)+1
  25. 113 IF 3*INT((M-1)/3)+1=M THEN K=1
  26. 114 IF 3*INT((M-1)/3)+2=M THEN K=2
  27. 115 IF 3*INT((M-1)/3)+3=M THEN K=3
  28. 116 GOTO 120
  29. 118 FOR J=1 TO 7 STEP 3:FOR K=1 TO 3
  30. 120 IF SS(J)<>G THEN 130
  31. 122 IF SS(J+2)<>G THEN 135
  32. 126 IF SS(J+1)<>0 THEN 150
  33. 128 SS(J+1)=-1:GOTO 195
  34. 130 IF SS(J)=H THEN 150
  35. 131 IF SS(J+2)<>G THEN 150
  36. 132 IF SS(J+1)<>G THEN 150
  37. 133 SS(J)=-1:GOTO 195
  38. 135 IF SS(J+2)<>0 THEN 150
  39. 136 IF SS(J+1)<>G THEN 150
  40. 138 SS(J+2)=-1:GOTO 195
  41. 150 IF SS(K)<>G THEN 160
  42. 152 IF SS(K+6)<>G THEN 165
  43. 156 IF SS(K+3)<>0 THEN 170
  44. 158 SS(K+3)=-1:GOTO 195
  45. 160 IF SS(K)=H THEN 170
  46. 161 IF SS(K+6)<>G THEN 170
  47. 162 IF SS(K+3)<>G THEN 170
  48. 163 SS(K)=-1:GOTO 195
  49. 165 IF SS(K+6)<>0 THEN 170
  50. 166 IF SS(K+3)<>G THEN 170
  51. 168 SS(K+6)=-1:GOTO 195
  52. 170 GOTO 450
  53. 171 IF SS(3)=G AND SS(7)=0 THEN 187
  54. 172 IF SS(9)=G AND SS(1)=0 THEN 181
  55. 173 IF SS(7)=G AND SS(3)=0 THEN 183
  56. 174 IF SS(9)=0 AND SS(1)=G THEN 189
  57. 175 IF G=-1 THEN G=1:H=-1:GOTO 110
  58. 176 IF SS(9)=1 AND SS(3)=0 THEN 182
  59. 177 FOR I=2 TO 9:IF SS(I)<>0 THEN 179
  60. 178 SS(I)=-1:GOTO 195
  61. 179 NEXT I
  62. 181 SS(1)=-1:GOTO 195
  63. 182 IF SS(1)=1 THEN 177
  64. 183 SS(3)=-1:GOTO 195
  65. 187 SS(7)=-1:GOTO 195
  66. 189 SS(9)=-1
  67. 195 PRINT:PRINT"THE COMPUTER MOVES TO..."
  68. 202 GOSUB 1000
  69. 205 GOTO 500
  70. 450 IF G=1 THEN 465
  71. 455 IF J=7 AND K=3 THEN 465
  72. 460 NEXT K:NEXT J
  73. 465 IF SS(5)=G THEN 171
  74. 467 GOTO 175
  75. 475 P$="X":Q$="O"
  76. 500 PRINT:INPUT"WHERE DO YOU MOVE";M
  77. 502 IF M=0 THEN PRINT"THANKS FOR THE GAME.":GOTO 2000
  78. 503 IF M>9 THEN 506
  79. 505 IF SS(M)=0 THEN 510
  80. 506 PRINT"THAT SQUARE IS OCCUPIED.":PRINT:PRINT:GOTO 500
  81. 510 G=1:SS(M)=1
  82. 520 GOSUB 1000
  83. 530 GOTO 100
  84. 1000 PRINT:FOR I=1 TO 9:PRINT" ";:IF SS(I)<>-1 THEN 1014
  85. 1012 PRINT Q$;" ";:GOTO 1020
  86. 1014 IF SS(I)<>0 THEN 1018
  87. 1016 PRINT" ";:GOTO 1020
  88. 1018 PRINT P$;" ";
  89. 1020 IF I<>3 AND I<>6 THEN 1050
  90. 1030 PRINT:PRINT"---+---+---"
  91. 1040 GOTO 1080
  92. 1050 IF I=9 THEN 1080
  93. 1060 PRINT"!";
  94. 1080 NEXT I:PRINT:PRINT:PRINT
  95. 1095 FOR I=1 TO 7 STEP 3
  96. 1100 IF SS(I)<>SS(I+1)THEN 1115
  97. 1105 IF SS(I)<>SS(I+2)THEN 1115
  98. 1110 IF SS(I)=-1 THEN 1350
  99. 1112 IF SS(I)=1 THEN 1200
  100. 1115 NEXT I:FOR I=1 TO 3:IF SS(I)<>SS(I+3)THEN 1150
  101. 1130 IF SS(I)<>SS(I+6)THEN 1150
  102. 1135 IF SS(I)=-1 THEN 1350
  103. 1137 IF SS(I)=1 THEN 1200
  104. 1150 NEXT I:FOR I=1 TO 9:IF SS(I)=0 THEN 1155
  105. 1152 NEXT I:GOTO 1400
  106. 1155 IF SS(5)<>G THEN 1170
  107. 1160 IF SS(1)=G AND SS(9)=G THEN 1180
  108. 1165 IF SS(3)=G AND SS(7)=G THEN 1180
  109. 1170 RETURN
  110. 1180 IF G=-1 THEN 1350
  111. 1200 PRINT"YOU BEAT ME!! GOOD GAME.":GOTO 2000
  112. 1350 PRINT"I WIN, TURKEY!!!":GOTO 2000
  113. 1400 PRINT"IT'S A DRAW. THANK YOU."
  114. 2000 END