Author Topic: Tic Tac Toe  (Read 3439 times)

0 Members and 1 Guest are viewing this topic.

Offline Jaze

  • Newbie
  • Posts: 86
    • View Profile
Tic Tac Toe
« on: August 18, 2021, 02:59:29 pm »
I have a Tic Tac Toe app on my phone. I often win. I had to make my own. . . . I swear my apartment has turned into one big SELECT CASE
Code: QB64: [Select]
  1. CONST TRUE = 1
  2. CONST FALSE = 0
  3. CONST xWon = 1
  4. CONST oWon = 2
  5. CONST tie = 3
  6. CONST acrossTop = 1
  7. CONST acrossMid = 2
  8. CONST acrossBot = 3
  9. CONST vertL = 4
  10. CONST vertM = 5
  11. CONST vertR = 6
  12. CONST diagTL = 7
  13. CONST diagBL = 8
  14. CONST delay = 0.02
  15. CONST computeR = 1
  16. CONST playeR = 2
  17.  
  18. DIM SHARED gameString$: gameString$ = ""
  19. DIM SHARED gameOver: gameOver = FALSE
  20.  
  21.  
  22. GOTO beginning
  23.  
  24. crap:
  25. PRINT "Error, line the error is on"
  26. CALL P(TRUE)
  27.  
  28. beginning:
  29. WIDTH 80, 50
  30.  
  31. CALL StartTheGame
  32. SUB EasyGame (firstMove)
  33.     CALL PrintGrid
  34.     FOR eachMove = 1 TO 9
  35.         winner = 0
  36.         IF firstMove = playeR THEN
  37.             here = GetLocation
  38.             gameString$ = gameString$ + "X" + S$(here)
  39.             PrintX (here)
  40.             winner = CheckTieOrWin
  41.             IF winner <> 0 THEN
  42.                 CALL EndOfGame
  43.                 EXIT FOR
  44.             END IF
  45.             somewhereElse:
  46.             here = INT(RND * 9) + 1
  47.             IF INSTR(gameString$, S$(here)) <> 0 THEN GOTO somewhereElse
  48.             gameString$ = gameString$ + "O" + S$(here)
  49.             CALL PrintO(here)
  50.             eachMove = eachMove + 1
  51.             winner = CheckTieOrWin
  52.             IF winner <> 0 THEN
  53.                 CALL EndOfGame
  54.                 EXIT FOR
  55.             END IF
  56.         ELSEIF firstMove = computeR THEN
  57.             anotherSomewhereElse:
  58.             here = INT(RND * 9) + 1
  59.             IF INSTR(gameString$, S$(here)) <> 0 THEN GOTO anotherSomewhereElse
  60.             gameString$ = gameString$ + "O" + S$(here)
  61.             CALL PrintO(here)
  62.             winner = CheckTieOrWin
  63.             IF winner <> 0 THEN
  64.                 CALL EndOfGame
  65.                 EXIT FOR
  66.             END IF
  67.             here = GetLocation
  68.             gameString$ = gameString$ + "X" + S$(here)
  69.             PrintX (here)
  70.             winner = CheckTieOrWin
  71.             IF winner <> 0 THEN
  72.                 CALL EndOfGame
  73.                 EXIT FOR
  74.             END IF
  75.         ELSE
  76.             PRINT "What": PRINT: PRINT "          the": PRINT: PRINT "                      FUCK!!!"
  77.         END IF
  78.     NEXT eachMove
  79.     END
  80.  
  81. SUB StartTheGame
  82.     whoGoesFirst = 0
  83.     repeat:
  84.     COLOR 11, 13
  85.     CLS
  86.     a$ = "Player is X, Computer is O"
  87.     LOCATE 15, Center(a$): PRINT a$
  88.     a$ = "Who goes first?  [C]omputer or [P]layer "
  89.     LOCATE 25, Center(a$): PRINT a$;
  90.     answer$ = UCASE$(INPUT$(1))
  91.     PRINT answer$
  92.     IF answer$ <> "C" AND answer$ <> "P" AND answer$ <> "X" AND answer$ <> "O" THEN
  93.         GOTO repeat
  94.     ELSEIF answer$ = "C" OR answer$ = "O" THEN
  95.         whoGoesFirst = computeR
  96.     ELSEIF answer$ = "P" OR answer$ = "X" THEN
  97.         whoGoesFirst = playeR
  98.     END IF
  99.  
  100.     a$ = "Difficulty? [E]asy or [H]ard "
  101.     LOCATE 30, Center(a$): PRINT a$;
  102.     difficulty$ = UCASE$(INPUT$(1))
  103.     PRINT difficulty$
  104.     IF difficulty$ = "E" THEN
  105.         CALL EasyGame(whoGoesFirst)
  106.     ELSEIF difficulty$ = "H" THEN
  107.         IF whoGoesFirst = computeR THEN
  108.             CALL ComputerFirst
  109.         ELSEIF whoGoesFirst = playeR THEN
  110.             CALL PlayerFirst
  111.         ELSE
  112.             GOTO repeat
  113.         END IF
  114.     ELSE
  115.         GOTO repeat
  116.     END IF
  117.  
  118.  
  119.  
  120. SUB PrintGrid
  121.     COLOR 11, 13
  122.     CLS
  123.     FOR y = 4 TO 45
  124.         LOCATE y, 30
  125.         PRINT CHR$(219)
  126.         LOCATE y, 50
  127.         PRINT CHR$(219)
  128.     NEXT y
  129.     FOR x = 17 TO 63
  130.         LOCATE 15, x
  131.         PRINT CHR$(219)
  132.         LOCATE 30, x
  133.         PRINT CHR$(219)
  134.     NEXT x
  135.     LOCATE 9, 22: PRINT "1"
  136.     LOCATE 9, 40: PRINT "2"
  137.     LOCATE 9, 58: PRINT "3"
  138.     LOCATE 23, 22: PRINT "4"
  139.     LOCATE 23, 40: PRINT "5"
  140.     LOCATE 23, 58: PRINT "6"
  141.     LOCATE 37, 22: PRINT "7"
  142.     LOCATE 37, 40: PRINT "8"
  143.     LOCATE 37, 58: PRINT "9"
  144.  
  145. SUB PrintX (location)
  146.     x = 19: y = 4
  147.     SELECT CASE location
  148.         CASE 1
  149.             LOCATE 9, 22: PRINT " "
  150.             x = 19: y = 4
  151.         CASE 2
  152.             LOCATE 9, 40: PRINT " "
  153.             x = 36: y = 4
  154.         CASE 3
  155.             LOCATE 9, 58: PRINT " "
  156.             x = 53: y = 4
  157.         CASE 4
  158.             LOCATE 23, 22: PRINT " "
  159.             x = 19: y = 18
  160.         CASE 5
  161.             LOCATE 23, 40: PRINT " "
  162.             x = 36: y = 18
  163.         CASE 6
  164.             LOCATE 23, 58: PRINT " "
  165.             x = 53: y = 18
  166.         CASE 7
  167.             LOCATE 37, 22: PRINT " "
  168.             x = 19: y = 32
  169.         CASE 8
  170.             LOCATE 37, 40: PRINT " "
  171.             x = 36: y = 32
  172.         CASE 9
  173.             x = 53: y = 32
  174.             LOCATE 37, 58: PRINT " "
  175.     END SELECT
  176.     FOR count = 0 TO 9
  177.         CALL PLOT(x + count, y + count)
  178.     NEXT count
  179.  
  180.     CALL PLOT(x + 9, y)
  181.     CALL PLOT(x + 8, y + 1)
  182.     CALL PLOT(x + 7, y + 2)
  183.     CALL PLOT(x + 6, y + 3)
  184.     CALL PLOT(x + 5, y + 4)
  185.     CALL PLOT(x + 4, y + 5)
  186.     CALL PLOT(x + 3, y + 6)
  187.     CALL PLOT(x + 2, y + 7)
  188.     CALL PLOT(x + 1, y + 8)
  189.     CALL PLOT(x, y + 9)
  190.  
  191. SUB HLIN (xStart, xEnd, y)
  192.     FOR count = xStart TO xEnd
  193.         LOCATE y, count
  194.         PRINT CHR$(219)
  195.         _DELAY (delay)
  196.     NEXT count
  197.  
  198. SUB VLIN (y1, y2, x)
  199.     FOR count = y1 TO y2
  200.         LOCATE count, x
  201.         PRINT CHR$(219)
  202.         _DELAY (delay)
  203.     NEXT count
  204.  
  205. SUB PLOT (x, y)
  206.     LOCATE y, x
  207.     PRINT CHR$(219)
  208.     _DELAY (delay)
  209.  
  210. SUB PrintO (location)
  211.     SELECT CASE location
  212.         CASE 1
  213.             x = 20: y = 4
  214.             LOCATE 9, 22: PRINT " "
  215.         CASE 2
  216.             LOCATE 9, 40: PRINT " "
  217.             x = 38: y = 4
  218.         CASE 3
  219.             LOCATE 9, 58: PRINT " "
  220.             x = 55: y = 4
  221.         CASE 4
  222.             LOCATE 23, 22: PRINT " "
  223.             x = 20: y = 18
  224.         CASE 5
  225.             LOCATE 23, 40: PRINT " "
  226.             x = 38: y = 18
  227.         CASE 6
  228.             LOCATE 23, 58: PRINT " "
  229.             x = 55: y = 18
  230.         CASE 7
  231.             LOCATE 37, 22: PRINT " "
  232.             x = 20: y = 34
  233.         CASE 8
  234.             LOCATE 37, 40: PRINT " "
  235.             x = 38: y = 34
  236.         CASE 9
  237.             LOCATE 37, 58: PRINT " "
  238.             x = 55: y = 34
  239.     END SELECT
  240.  
  241.     CALL HLIN(x, x + 4, y)
  242.     CALL PLOT(x - 1, y + 1): CALL PLOT(x + 5, y + 1)
  243.     CALL VLIN(y + 2, y + 6, x - 2): CALL VLIN(y + 2, y + 6, x + 6)
  244.     CALL PLOT(x - 1, y + 7): CALL PLOT(x + 5, y + 7)
  245.     CALL HLIN(x, x + 4, y + 8)
  246.  
  247. SUB ComputerFirst
  248.     CALL PrintGrid
  249.     gameString$ = "O1"
  250.     CALL PrintO(1)
  251.     playersMove = GetLocation
  252.     gameString$ = gameString$ + "X" + S$(playersMove)
  253.     CALL PrintX(playersMove)
  254.     SELECT CASE gameString$
  255.         CASE "O1X2", "O1X3", "O1X6", "O1X8", "O1X9"
  256.             gameString$ = gameString$ + "O7"
  257.             CALL PrintO(7)
  258.         CASE "O1X4", "O1X5"
  259.             gameString$ = gameString$ + "O3"
  260.             CALL PrintO(3)
  261.         CASE "O1X7"
  262.             gameString$ = gameString$ + "O9"
  263.             CALL PrintO(9)
  264.     END SELECT
  265.     playersMove = GetLocation
  266.     gameString$ = gameString$ + "X" + S$(playersMove)
  267.     CALL PrintX(playersMove)
  268.     SELECT CASE gameString$
  269.         CASE "O1X2O7X3", "O1X2O7X5", "O1X2O7X6", "O1X2O7X8", "O1X2O7X9"
  270.             gameString$ = gameString$ + "O4"
  271.             CALL PrintO(4)
  272.             CALL WinLine(vertL)
  273.         CASE "O1X2O7X4"
  274.             gameString$ = gameString$ + "O9"
  275.             CALL PrintO(9)
  276.         CASE "O1X3O7X2", "O1X3O7X5", "O1X3O7X6", "O1X3O7X8", "O1X3O7X9"
  277.             gameString$ = gameString$ + "O4"
  278.             CALL PrintO(4)
  279.             CALL WinLine(vertL)
  280.         CASE "O1X3O7X4"
  281.             gameString$ = gameString$ + "O9"
  282.             CALL PrintO(9)
  283.         CASE "O1X4O3X5", "O1X4O3X6", "O1X4O3X7", "O1X4O3X8", "O1X4O3X9"
  284.             gameString$ = gameString$ + "O2"
  285.             CALL PrintO(2)
  286.             CALL WinLine(acrossTop)
  287.         CASE "O1X4O3X2"
  288.             gameString$ = gameString$ + "O5"
  289.             CALL PrintO(5)
  290.         CASE "O1X5O3X4", "O1X5O3X6", "O1X5O3X7", "O1X5O3X8", "O1X5O3X9"
  291.             gameString$ = gameString$ + "O2"
  292.             CALL PrintO(2)
  293.             CALL WinLine(acrossTop)
  294.         CASE "O1X5O3X2"
  295.             gameString$ = gameString$ + "O8"
  296.             CALL PrintO(8)
  297.         CASE "O1X6O7X2", "O1X6O7X3", "O1X6O7X5", "O1X6O7X8", "O1X6O7X9"
  298.             gameString$ = gameString$ + "O4"
  299.             CALL PrintO(4)
  300.             CALL WinLine(vertL)
  301.         CASE "O1X6O7X4"
  302.             gameString$ = gameString$ + "O5"
  303.             CALL PrintO(5)
  304.         CASE "O1X7O9X2", "O1X7O9X3", "O1X7O9X4", "O1X7O9X6", "O1X7O9X8"
  305.             gameString$ = gameString$ + "O5"
  306.             CALL PrintO(5)
  307.             CALL WinLine(diagTL)
  308.         CASE "O1X7O9X5"
  309.             gameString$ = gameString$ + "O3"
  310.             CALL PrintO(3)
  311.         CASE "O1X8O7X2", "O1X8O7X3", "O1X8O7X5", "O1X8O7X6", "O1X8O7X9"
  312.             gameString$ = gameString$ + "O4"
  313.             CALL PrintO(4)
  314.             CALL WinLine(vertL)
  315.         CASE "O1X8O7X4"
  316.             gameString$ = gameString$ + "O3"
  317.             CALL PrintO(3)
  318.         CASE "O1X9O7X2", "O1X9O7X3", "O1X9O7X5", "O1X9O7X6", "O1X9O7X8"
  319.             gameString$ = gamerstring$ + "O4"
  320.             CALL PrintO(4)
  321.             CALL WinLine(vertL)
  322.         CASE "O1X9O7X4"
  323.             gameString$ = gameString$ + "O3"
  324.             CALL PrintO(3)
  325.     END SELECT
  326.     winner = CheckTieOrWin
  327.     IF winner <> 0 THEN CALL EndOfGame
  328.     playersMove = GetLocation
  329.     gameString$ = gameString$ + "X" + S$(playersMove)
  330.     CALL PrintX(playersMove)
  331.     winner = CheckTieOrWin
  332.     IF winner <> 0 THEN CALL EndOfGame
  333.     SELECT CASE gameString$
  334.         CASE "O1X2O7X4O9X3", "O1X2O7X4O9X5", "O1X2O7X4O9X6"
  335.             gameString$ = gameString$ + "O8"
  336.             CALL PrintO(8)
  337.             CALL WinLine(acrossBot)
  338.         CASE "O1X2O7X4O9X8"
  339.             gameString$ = gameString$ + "O5"
  340.             CALL PrintO(5)
  341.             CALL WinLine(diagTL)
  342.         CASE "O1X3O7X4O9X2", "O1X3O7X4O9X5", "O1X3O7X4O9X6"
  343.             gameString$ = gameString$ + "O8"
  344.             CALL PrintO(8)
  345.             CALL WinLine(acrossBot)
  346.         CASE "O1X3O7X4O9X8"
  347.             gamesring$ = gamestr4ing$ + "O5"
  348.             CALL PrintO(5)
  349.             CALL WinLine(diagTL)
  350.         CASE "O1X4O3X2O5X6", "O1X4O3X2O5X7", "O1X4O3X2O5X8"
  351.             gameString$ = gameString$ + "O9"
  352.             CALL PrintO(9)
  353.             CALL WinLine(diagTL)
  354.         CASE "O1X4O3X2O5X9"
  355.             CALL PrintO(7)
  356.             CALL WinLine(diagBL)
  357.         CASE "O1X5O3X2O8X4"
  358.             gameString$ = gameString$ + "O6"
  359.             CALL PrintO(6)
  360.         CASE "O1X5O3X2O8X6", "O1X5O3X2O8X9"
  361.             gameString$ = gameString$ + "O4"
  362.             CALL PrintO(4)
  363.         CASE "O1X5O3X2O8X7"
  364.             gameString$ = gameString$ + "O9"
  365.             CALL PrintO(9)
  366.         CASE "O1X6O7X4O5X2", "O1X6O7X4O5X3", "O1X6O7X4O5X8"
  367.             gameString$ = gameString$ + "O9"
  368.             CALL PrintO(9)
  369.             CALL WinLine(diagTL)
  370.         CASE "O1X6O7X4O5X9"
  371.             gameString$ = gameString$ + "O3"
  372.             CALL PrintO(3)
  373.             CALL WinLine(diagBL)
  374.         CASE "O1X7O9X5O3X2", "O1X7O9X5O3X4", "O1X7O9X5O3X8"
  375.             gameString$ = gameString$ + "O6"
  376.             CALL PrintO(6)
  377.             CALL WinLine(vertR)
  378.         CASE "O1X7O9X5O3X6"
  379.             gameString$ = gameString$ + "O2"
  380.             CALL PrintO(2)
  381.             CALL WinLine(acrossTop)
  382.         CASE "O1X8O7X4O3X2", "O1X8O7X4O3X6", "O1X8O7X4O3X9"
  383.             gameString$ = gameString$ + "O5"
  384.             CALL PrintO(5)
  385.             CALL WinLine(diagBL)
  386.         CASE "O1X8O7X4O3X5"
  387.             gameString$ = gameString$ + "O2"
  388.             CALL PrintO(2)
  389.             CALL WinLine(acrossTop)
  390.         CASE "O1X9O7X4O3X2"
  391.             gameString$ = gameString$ + "O5"
  392.             CALL PrintO(5)
  393.             CALL WinLine(diagBL)
  394.         CASE "O1X9O7X4O3X5", "O1X9O7X4O3X6", "O1X9O7X4O3X8"
  395.             gameString$ = gameString$ + "O2"
  396.             CALL PrintO(2)
  397.             CALL WinLine(acrossTop)
  398.     END SELECT
  399.     winner = CheckTieOrWin
  400.     IF winner <> 0 THEN CALL EndOfGame
  401.     playersMove = GetLocation
  402.     gameString$ = gameString$ + "X" + S$(playersMove)
  403.     winner = CheckTieOrWin
  404.     IF winner <> 0 THEN CALL EndOfGame
  405.     CALL PrintX(playersMove)
  406.     SELECT CASE gameString$
  407.         CASE "O1X5O3X2O8X4O6X7" ', "O1X5O3X2O8X6O4X7"
  408.             gameString$ = gamesring$ + "O9"
  409.             CALL PrintO(9)
  410.             CALL WinLine(vertR)
  411.         CASE "O1X5O3X2O8X4O6X9"
  412.             gameString$ = gameString$ + "O7"
  413.             CALL PrintO(8)
  414.         CASE "O1X5O3X2O8X6O4X7"
  415.             gameString$ = gameString$ + "O9"
  416.             CALL PrintO(9)
  417.         CASE "O1X5O3X2O8X6O4X9"
  418.             gameString$ = gameString$ + "O7"
  419.             CALL PrintO(7)
  420.             CALL WinLine(vertL)
  421.         CASE "O1X5O3X2O8X9O4X7"
  422.             gameString$ = gameString$ + "O6"
  423.             CALL PrintO(6)
  424.         CASE "O1X5O3X2O8X7O9X4"
  425.             gameString$ = gameString$ + "O6"
  426.             CALL PrintO(6)
  427.             CALL WinLine(vertR)
  428.         CASE "O1X5O3X2O8X7O9X6"
  429.             gameString$ = gameString$ + "O4"
  430.             CALL PrintO(4)
  431.         CASE "O1X5O3X2O8X9O4X6"
  432.             gameString$ = gameString$ + "O7"
  433.             CALL PrintO(7)
  434.             CALL WinLine(vertL)
  435.     END SELECT
  436.     winner = CheckTieOrWin
  437.     IF winner <> 0 THEN CALL EndOfGame
  438.  
  439. SUB EndOfGame
  440.     _DELAY (1)
  441.     repeat:
  442.     CLS
  443.     COLOR 0, 13
  444.     a$ = "Do you want to watch a replay? (Y / N) "
  445.     LOCATE 20, Center(a$)
  446.     PRINT a$;
  447.     replay$ = UCASE$(INPUT$(1))
  448.     PRINT replay$
  449.     IF replay$ <> "Y" AND replay$ <> "N" THEN GOTO repeat
  450.     IF replay$ = "Y" THEN CALL WatchReplay
  451.     a$ = "Play again? (Y / N) "
  452.     LOCATE 30, Center(a$)
  453.     COLOR 0, 13: PRINT a$;
  454.     tryAgain:
  455.     again$ = UCASE$(INPUT$(1))
  456.     PRINT again$
  457.     IF again$ <> "Y" AND again$ <> "N" THEN GOTO tryAgain
  458.     IF again$ = "Y" THEN CALL StartTheGame
  459.  
  460. SUB WatchReplay
  461.     CALL PrintGrid
  462.     FOR countThroughString = 1 TO LEN(gameString$) STEP 2
  463.         mover$ = MID$(gameString$, countThroughString, 1)
  464.         play$ = MID$(gameString$, countThroughString + 1, 1)
  465.         IF mover$ = "X" THEN
  466.             CALL PrintX(VAL(play$))
  467.         ELSEIF mover$ = "O" THEN
  468.             CALL PrintO(VAL(play$))
  469.         END IF
  470.         _DELAY (0.8)
  471.     NEXT countThroughString
  472.     winner = CheckTieOrWin
  473.     IF winner <> 0 THEN CALL EndOfGame
  474.  
  475. FUNCTION CheckTieOrWin
  476.     'allFilled = TRUE
  477.     rtn = 0
  478.     who$ = "X"
  479.     IF INSTR(gameString$, who$ + "1") <> 0 AND INSTR(gameString$, who$ + "2") <> 0 AND INSTR(gameString$, who$ + "3") <> 0 THEN
  480.         CALL WinLine(acrossTop)
  481.         rtn = xWon
  482.     ELSEIF INSTR(gameString$, who$ + "4") <> 0 AND INSTR(gameString$, who$ + "5") <> 0 AND INSTR(gameString$, who$ + "6") <> 0 THEN
  483.         CALL WinLine(acrossMid)
  484.         rtn = xWon
  485.     ELSEIF INSTR(gameString$, who$ + "7") <> 0 AND INSTR(gameString$, who$ + "8") <> 0 AND INSTR(gameString$, who$ + "9") <> 0 THEN
  486.         CALL WinLine(acrossBot)
  487.         rtn = xWon
  488.     ELSEIF INSTR(gameString$, who$ + "1") <> 0 AND INSTR(gameString$, who$ + "4") <> 0 AND INSTR(gameString$, who$ + "7") <> 0 THEN
  489.         CALL WinLine(vertL)
  490.         rtn = xWon
  491.     ELSEIF INSTR(gameString$, who$ + "2") <> 0 AND INSTR(gameString$, who$ + "5") <> 0 AND INSTR(gameString$, who$ + "8") <> 0 THEN
  492.         CALL WinLine(vertM)
  493.         rtn = xWon
  494.     ELSEIF INSTR(gameString$, who$ + "3") <> 0 AND INSTR(gameString$, who$ + "6") <> 0 AND INSTR(gameString$, who$ + "9") <> 0 THEN
  495.         CALL WinLine(vertR)
  496.         rtn = xWon
  497.     ELSEIF INSTR(gameString$, who$ + "1") <> 0 AND INSTR(gameString$, who$ + "5") <> 0 AND INSTR(gameString$, who$ + "9") <> 0 THEN
  498.         CALL WinLine(diagTL)
  499.         rtn = xWon
  500.     ELSEIF INSTR(gameString$, who$ + "3") <> 0 AND INSTR(gameString$, who$ + "5") <> 0 AND INSTR(gameString$, who$ + "7") <> 0 THEN
  501.         CALL WinLine(diagBL)
  502.         rtn = xWon
  503.     END IF
  504.     who$ = "O"
  505.     IF INSTR(gameString$, who$ + "1") <> 0 AND INSTR(gameString$, who$ + "2") <> 0 AND INSTR(gameString$, who$ + "3") <> 0 THEN
  506.         CALL WinLine(acrossTop)
  507.         rtn = oWon
  508.     ELSEIF INSTR(gameString$, who$ + "4") <> 0 AND INSTR(gameString$, who$ + "5") <> 0 AND INSTR(gameString$, who$ + "6") <> 0 THEN
  509.         WinLine (acrossMid)
  510.         rtn = oWon
  511.     ELSEIF INSTR(gameString$, who$ + "7") <> 0 AND INSTR(gameString$, who$ + "8") <> 0 AND INSTR(gameString$, who$ + "9") <> 0 THEN
  512.         WinLine (acrossBot)
  513.         rtn = oWon
  514.     ELSEIF INSTR(gameString$, who$ + "1") <> 0 AND INSTR(gameString$, who$ + "4") <> 0 AND INSTR(gameString$, who$ + "7") <> 0 THEN
  515.         WinLine (vertL)
  516.         rtn = oWon
  517.     ELSEIF INSTR(gameString$, who$ + "2") <> 0 AND INSTR(gameString$, who$ + "5") <> 0 AND INSTR(gameString$, who$ + "8") <> 0 THEN
  518.         CALL WinLine(vertM)
  519.         rtn = oWon
  520.     ELSEIF INSTR(gameString$, who$ + "3") <> 0 AND INSTR(gameString$, who$ + "6") <> 0 AND INSTR(gameString$, who$ + "9") <> 0 THEN
  521.         CALL WinLine(vertR)
  522.         rtn = oWon
  523.     ELSEIF INSTR(gameString$, who$ + "1") <> 0 AND INSTR(gameString$, who$ + "5") <> 0 AND INSTR(gameString$, who$ + "9") <> 0 THEN
  524.         CALL WinLine(diagTL)
  525.         rtn = oWon
  526.     ELSEIF INSTR(gameString$, who$ + "3") <> 0 AND INSTR(gameString$, who$ + "5") <> 0 AND INSTR(gameString$, who$ + "7") <> 0 THEN
  527.         WinLine (diagBL)
  528.         rtn = oWon
  529.     ELSEIF LEN(gameString$) = 18 THEN
  530.         rtn = tie
  531.     END IF
  532.     IF rtn <> 0 THEN
  533.         CALL EndOfGame
  534.     ELSE
  535.         CheckTieOrWin = rtn
  536.     END IF
  537.  
  538. SUB PlayerFirst
  539.     CALL PrintGrid
  540.     playerMove = GetLocation
  541.     gameString$ = "X" + S$(playerMove)
  542.     PrintX (playerMove)
  543.     SELECT CASE playerMove
  544.         CASE 1
  545.             CALL X1
  546.         CASE 2
  547.             CALL X2
  548.         CASE 3
  549.             CALL X3
  550.         CASE 4
  551.             CALL X4
  552.         CASE 5
  553.             CALL X5
  554.         CASE 6
  555.             CALL X6
  556.         CASE 7
  557.             CALL X7
  558.         CASE 8
  559.             CALL X8
  560.         CASE 9
  561.             CALL X9
  562.     END SELECT
  563.     CALL EndOfGame
  564.  
  565. SUB X1
  566.     gameString$ = gameString$ + "O5"
  567.     CALL PrintO(5)
  568.     playerMove = GetLocation
  569.     gameString$ = gameString$ + "X" + S$(playerMove)
  570.     CALL PrintX(playerMove)
  571.     SELECT CASE gameString$
  572.         CASE "X1O5X2"
  573.             gameString$ = gameString$ + "O3"
  574.             CALL PrintO(3)
  575.         CASE "X1O5X3"
  576.             gameString$ = gameString$ + "O2"
  577.             CALL PrintO(2)
  578.         CASE "X1O5X4"
  579.             gameString$ = gameString$ + "O7"
  580.             CALL PrintO(7)
  581.         CASE "X1O5X6"
  582.             gameString$ = gameString$ + "O3"
  583.             CALL PrintO(3)
  584.         CASE "X1O5X7"
  585.             gameString$ = gameString$ + "O4"
  586.             CALL PrintO(4)
  587.         CASE "X1O5X8"
  588.             gameString$ = gameString$ + "O4"
  589.             CALL PrintO(4)
  590.         CASE "X1O5X9"
  591.             gameString$ = gameString$ + "O2"
  592.             CALL PrintO(2)
  593.     END SELECT
  594.     playerMove = GetLocation
  595.     '    COLOR 15, 0: LOCATE 46, 10: PRINT gameString$: COLOR 11, 13: CALL P(TRUE)
  596.     gameString$ = gameString$ + "X" + S$(playerMove)
  597.     CALL PrintX(playerMove)
  598.     SELECT CASE gameString$
  599.         CASE "X1O5X2O3X4", "X1O5X2O3X6", "X1O5X2O3X8", "X1O5X2O3X9"
  600.             gameString$ = gameString$ + "O7"
  601.             CALL PrintO(7)
  602.             CALL WinLine(diagBL)
  603.         CASE "X1O5X2O3X7"
  604.             gameString$ = gameString$ + "O4"
  605.             CALL PrintO(4)
  606.         CASE "X1O5X3O2X4", "X1O5X3O2X6", "X1O5X3O2X7", "X1O5X3O2X9"
  607.             gameString$ = gameString$ + "O8"
  608.             CALL PrintO(8)
  609.             CALL WinLine(vertM)
  610.         CASE "X1O5X3O2X8"
  611.             gameString$ = gameString$ + "O4"
  612.             CALL PrintO(4)
  613.         CASE "X1O5X4O7X2", "X1O5X4O7X6", "X1O5X4O7X8", "X1O5X4O7X9"
  614.             gameString$ = gameString$ + "O3"
  615.             CALL PrintO(3)
  616.             CALL WinLine(diagBL)
  617.         CASE "X1O5X4O7X3"
  618.             gameString$ = gameString$ + "O2"
  619.             CALL PrintO(2)
  620.         CASE "X1O5X6O3X2", "X1O5X6O3X4", "X1O5X6O3X8", "X1O5X6O3X9"
  621.             gameString$ = gameString$ + "O7"
  622.             CALL PrintO(7)
  623.             CALL WinLine(diagBL)
  624.         CASE "X1O5X6O3X7"
  625.             gameString$ = gameString$ + "O4"
  626.             CALL PrintO(4)
  627.         CASE "X1O5X7O4X2", "X1O5X7O4X3", "X1O5X7O4X8", "X1O5X7O4X9"
  628.             gameString$ = gameString$ + "O6"
  629.             CALL PrintO(6)
  630.             CALL WinLine(acrossMid)
  631.         CASE "X1O5X7O4X6"
  632.             gameString$ = gameString$ + "O2"
  633.             CALL PrintO(2)
  634.         CASE "X1O5X8O4X2", "X1O5X8O4X3", "X1O5X8O4X7", "X1O5X8O4X9"
  635.             gameString$ = gameString$ + "O6"
  636.             CALL PrintO(6)
  637.             CALL WinLine(acrossMid)
  638.         CASE "X1O5X8O4X6"
  639.             gameString$ = gameString$ + "O3"
  640.             CALL PrintO(3)
  641.         CASE "X1O5X9O2X3", "X1O5X9O2X4", "X1O5X9O2X6", "X1O5X9O2X7"
  642.             gameString$ = gameString$ + "O8"
  643.             CALL PrintO(8)
  644.             CALL WinLine(vertM)
  645.         CASE "X1O5X9O2X8"
  646.             gameString$ = gameString$ + "O7"
  647.             CALL PrintO(7)
  648.     END SELECT
  649.     playerMove = GetLocation
  650.     gameString$ = gameString$ + "X" + S$(playerMove)
  651.     CALL PrintX(playerMove)
  652.     SELECT CASE gameString$
  653.         CASE "X1O5X2O3X7O4X8", "X1O5X2O3X7O4X9"
  654.             gameString$ = gameString$ + "O6"
  655.             CALL PrintO(6)
  656.             CALL WinLine(acrossMid)
  657.         CASE "X1O5X2O3X7O4X6"
  658.             gameString$ = gameString$ + "O8"
  659.             CALL PrintO(8)
  660.         CASE "X1O5X3O2X8O4X7", "X1O5X3O2X8O4X9"
  661.             gameString$ = gameString$ + "O6"
  662.             CALL PrintO(6)
  663.             CALL WinLine(acrossMid)
  664.         CASE "X1O5X3O2X8O4X6"
  665.             gameString$ = gameString$ + "O9"
  666.             CALL PrintO(9)
  667.         CASE "X1O5X4O7X3O2X6", "X1O5X4O7X3O2X9"
  668.             gameString$ = gameString$ + "O8"
  669.             CALL PrintO(8)
  670.             CALL WinLine(vertM)
  671.         CASE "X1O5X4O7X3O2X8"
  672.             gameString$ = gameString$ + "O6"
  673.             CALL PrintO(6)
  674.         CASE "X1O5X6O3X7O4X2", "X1O5X6O3X7O4X9"
  675.             gameString$ = gameString$ + "O8"
  676.             CALL PrintO(8)
  677.         CASE "X1O5X6O3X7O4X8"
  678.             gameString$ = gameString$ + "O9"
  679.             CALL PrintO(9)
  680.         CASE "X1O5X7O4X6O2X3", "X1O5X7O4X6O2X9"
  681.             gamest4ring$ = gameastring$ + "O8"
  682.             CALL PrintO(8)
  683.             CALL WinLine(vertM)
  684.         CASE "X1O5X7O4X6O2X8"
  685.             gameString$ = gameString$ + "O9"
  686.             CALL PrintO(9)
  687.         CASE "X1O5X8O4X6O3X2", "X1O5X8O4X6O3X9"
  688.             gameString$ = gameString$ + "O7"
  689.             CALL PrintO(7)
  690.             CALL WinLine(diagBL)
  691.         CASE "X1O5X8O4X6O3X7"
  692.             gameString$ = gameString$ + "O9"
  693.             CALL PrintO(9)
  694.         CASE "X1O5X9O2X8O7X4", "X1O5X9O2X8O7X6"
  695.             gameString$ = gameString$ + "O3"
  696.             CALL PrintO(3)
  697.             CALL WinLine(diagBL)
  698.         CASE "X1O5X9O2X8O7X3"
  699.             gameString$ = gameString$ + "O6"
  700.             CALL PrintO(6)
  701.     END SELECT
  702.     playerMove = GetLocation
  703.     gameString$ = gameString$ + "X" + S$(playerMove)
  704.     CALL PrintX(playerMove)
  705.  
  706. SUB WinLine (direction)
  707.     COLOR 10, 13
  708.     SELECT CASE direction
  709.         CASE acrossTop
  710.             CALL HLIN(16, 62, 9)
  711.         CASE acrossMid
  712.             CALL HLIN(16, 62, 23)
  713.         CASE acrossBot
  714.             CALL HLIN(16, 62, 37)
  715.         CASE vertL
  716.             CALL VLIN(2, 44, 22)
  717.         CASE vertM
  718.             CALL VLIN(2, 44, 40)
  719.         CASE vertR
  720.             CALL VLIN(2, 44, 57)
  721.         CASE diagTL
  722.             FOR count = 0 TO 40
  723.                 CALL PLOT(count + 21, count + 4)
  724.             NEXT count
  725.         CASE diagBL
  726.             y = 42 '48
  727.             FOR count = 0 TO 40
  728.                 CALL PLOT(count + 21, y)
  729.                 y = y - 1
  730.             NEXT count
  731.     END SELECT
  732.  
  733. SUB X2
  734.     gameString$ = gameString$ + "O5"
  735.     CALL PrintO(5)
  736.     playerMove = GetLocation
  737.     gameString$ = gameString$ + "X" + S$(playerMove)
  738.     CALL PrintX(playerMove)
  739.     SELECT CASE gameString$
  740.         CASE "X2O5X1"
  741.             gameString$ = gameString$ + "O3"
  742.             CALL PrintO(3)
  743.         CASE "X2O5X3"
  744.             gameString$ = gameString$ + "O1"
  745.             CALL PrintO(1)
  746.         CASE "X2O5X4"
  747.             gameString$ = gameString$ + "O1"
  748.             CALL PrintO(1)
  749.         CASE "X2O5X6"
  750.             gameString$ = gameString$ + "O3"
  751.             CALL PrintO(3)
  752.         CASE "X2O5X7"
  753.             gameString$ = gameString$ + "O1"
  754.             CALL PrintO(1)
  755.         CASE "X2O5X8"
  756.             gameString$ = gameString$ + "O1"
  757.             CALL PrintO(1)
  758.         CASE "X2O5X9"
  759.             gameString$ = gameString$ + "O3"
  760.             CALL PrintO(3)
  761.     END SELECT
  762.     playerMove = GetLocation
  763.     gameString$ = gameString$ + "X" + S$(playerMove)
  764.     CALL PrintX(playerMove)
  765.     SELECT CASE gameString$
  766.         CASE "X2O5X1O3X4", "X2O5X1O3X6", "X2O5X1O3X8", "X2O5X1O3X9"
  767.             gameString$ = gameString$ + "O7"
  768.             CALL PrintO(7)
  769.             CALL WinLine(diagBL)
  770.         CASE "X2O5X1O3X7"
  771.             gameString$ = gameString$ + "O4"
  772.             CALL PrintO(4)
  773.         CASE "X2O5X3O1X4", "X2O5X3O1X6", "X2O5X3O1X7", "X2O5X3O1X8"
  774.             gameString$ = gameString$ + "O9"
  775.             CALL PrintO(9)
  776.             CALL WinLine(diagTL)
  777.         CASE "X2O5X3O1X9"
  778.             gameString$ = gameString$ + "O6"
  779.             CALL PrintO(6)
  780.         CASE "X2O5X4O1X3", "X2O5X4O1X6", "X2O5X4O1X7", "X2O5X4O1X8"
  781.             gameString$ = gameString$ + "O9"
  782.             CALL PrintO(9)
  783.             CALL WinLine(diagTL)
  784.         CASE "X2O5X4O1X9"
  785.             gameString$ = gameString$ + "O3"
  786.             CALL PrintO(3)
  787.         CASE "X2O5X6O3X1", "X2O5X6O3X4", "X2O5X6O3X8", "X2O5X6O3X9"
  788.             gameString$ = gameString$ + "O7"
  789.             CALL PrintO(7)
  790.             CALL WinLine(diagBL)
  791.         CASE "X2O5X6O3X7"
  792.             gameString$ = gameString$ + "O1"
  793.             CALL PrintO(1)
  794.         CASE "X2O5X7O1X3", "X2O5X7O1X4", "X2O5X7O1X6", "X2O5X7O1X8"
  795.             gameString$ = gameString$ + "O9"
  796.             CALL PrintO(9)
  797.             CALL WinLine(diagTL)
  798.         CASE "X2O5X7O1X9"
  799.             gameString$ = gameString$ + "O8"
  800.             CALL PrintO(8)
  801.         CASE "X2O5X8O1X3", "X2O5X8O1X4", "X2O5X8O1X6", "X2O5X8O1X7"
  802.             gameString$ = gameString$ + "O9"
  803.             CALL PrintO(9)
  804.             CALL WinLine(diagTL)
  805.         CASE "X2O5X8O1X9"
  806.             gameString$ = gameString$ + "O7"
  807.             CALL PrintO(7)
  808.         CASE "X2O5X9O3X1", "X2O5X9O3X4", "X2O5X9O3X6", "X2O5X9O3X8"
  809.             gameString$ = gameString$ + "O7"
  810.             CALL PrintO(7)
  811.             CALL WinLine(diagBL)
  812.         CASE "X2O5X9O3X7"
  813.             gameString$ = gameString$ + "O8"
  814.             CALL PrintO(8)
  815.     END SELECT
  816.     playerMove = GetLocation
  817.     gameString$ = gameString$ + "X" + S$(playerMove)
  818.     CALL PrintX(playerMove)
  819.     SELECT CASE gameString$
  820.         CASE "X2O5X1O3X7O4X8", "X2O5X1O3X7O4X9"
  821.             gameString$ = gameString$ + "X6"
  822.             CALL PrintO(6)
  823.             CALL WinLine(acrossMid)
  824.         CASE "X2O5X1O3X7O4X6"
  825.             gameString$ = gameString$ + "O8"
  826.             CALL PrintO(8)
  827.         CASE "X2O5X3O1X9O6X7", "X2O5X3O1X9O6X8"
  828.             gameString$ = gameString$ + "4"
  829.             CALL PrintO(4)
  830.             CALL WinLine(acrossMid)
  831.         CASE "X2O5X3O1X9O6X4"
  832.             gameString$ = gameString$ + "O7"
  833.             CALL PrintO(7)
  834.         CASE "X2O5X4O1X9O3X6", "X2O5X4O1X9O3X8"
  835.             gameString$ = gameString$ + "O7"
  836.             CALL PrintO(7)
  837.             CALL WinLine(diagBL)
  838.         CASE "X2O5X4O1X9O3X7"
  839.             gameString$ = gameString$ + "O8"
  840.             CALL PrintO(8)
  841.         CASE "X2O5X6O3X7O1X4", "X2O5X6O3X7O1X8"
  842.             gameString$ = gameString$ + "O9"
  843.             CALL PrintO(9)
  844.             CALL WinLine(diagTL)
  845.         CASE "X2O5X6O3X7O1X9"
  846.             gameString$ = gameString$ + "O8"
  847.             CALL PrintO(8)
  848.         CASE "X2O5X7O1X9O8X3"
  849.             gameString$ = gameString$ + "O6"
  850.             CALL PrintO(6)
  851.         CASE "X2O5X7O1X9O8X6"
  852.             gameString$ = gameString$ + "O3"
  853.             CALL PrintO(3)
  854.         CASE "X2O5X7O1X9O8X4"
  855.             gameString$ = gasmestring$ + "O3"
  856.             CALL PrintO(3)
  857.         CASE "X2O5X8O1X9O7X4", "X2O5X8O1X9O7X6"
  858.             gameString$ = gameString$ + "O3"
  859.             CALL PrintO(3)
  860.             CALL WinLine(diagBL)
  861.         CASE "X2O5X8O1X9O7X3"
  862.             gameString$ = gameString$ + "O4"
  863.             CALL PrintO(4)
  864.             CALL WinLine(vertL)
  865.         CASE "X2O5X9O3X7O8X1"
  866.             gameString$ = gameString$ + "O4"
  867.             CALL PrintO(4)
  868.         CASE "X2O5X9O3X7O8X4"
  869.             gameString$ = gameString$ + "O1"
  870.             CALL PrintO(1)
  871.         CASE "X2O5X9O3X7O8X6"
  872.             gameString$ = gameString$ + "O1"
  873.             CALL PrintO(1)
  874.     END SELECT
  875.     playerMove = GetLocation
  876.     gameString$ = gameString$ + "X" + S$(playerMove)
  877.     CALL PrintX(playerMove)
  878.  
  879. SUB X3
  880.     gameString$ = gameString$ + "O5"
  881.     CALL PrintO(5)
  882.     playerMove = GetLocation
  883.     gameString$ = gameString$ + "X" + S$(playerMove)
  884.     SELECT CASE gameString$
  885.         CASE "X3O5X1"
  886.             gameString$ = gameString$ + "O2"
  887.             CALL PrintO(2)
  888.         CASE "X3O5X2"
  889.             gameString$ = gameString$ + "O1"
  890.             CALL PrintO(1)
  891.         CASE "X3O5X4"
  892.             gameString$ = gameString$ + "O1"
  893.             CALL PrintO(1)
  894.         CASE "X3O5X6"
  895.             gameString$ = gameString$ + "O9"
  896.             CALL PrintO(9)
  897.         CASE "X3O5X7"
  898.             gameString$ = gameString$ + "O2"
  899.             CALL PrintO(2)
  900.         CASE "X3O5X8"
  901.             gameString$ = gameString$ + "O9"
  902.             CALL PrintO(9)
  903.         CASE "X3O5X9"
  904.             gameString$ = gameString$ + "O6"
  905.             CALL PrintO(6)
  906.     END SELECT
  907.     playerMove = GetLocation
  908.     gameString$ = gameString$ + "X" + S$(playerMove)
  909.     SELECT CASE gameString$
  910.         CASE "X3O5X1O2X4", "X3O5X1O2X6", "X3O5X1O2X7", "X3O5X1O2X9"
  911.             gameString$ = gameString$ + "O8"
  912.             CALL PrintO(8)
  913.             CALL WinLine(vertM)
  914.         CASE "X3O5X1O2X8" '********
  915.             gameString$ = gameString$ + "O4"
  916.             CALL PrintO(4)
  917.         CASE "X3O5X2O1X4", "X3O5X2O1X6", "X3O5X2O1X7", "X3O5X2O1X8"
  918.             gameString$ = gameString$ + "O9"
  919.             CALL PrintO(9)
  920.             CALL WinLine(diagTL)
  921.         CASE "X3O5X2O1X9" ' ***************
  922.             gameString$ = gameString$ + "O6"
  923.             CALL PrintO(6)
  924.         CASE "X3O5X4O1X2", "X3O5X4O1X6", "X3O5X4O1X7", "X3O5X4O1X8"
  925.             gameString$ = gamestgring$ + "O9"
  926.             CALL PrintO(9)
  927.             CALL WinLine(diagTL)
  928.         CASE "X3O5X4O1X9" '***********
  929.             gameString$ = gameString$ + "O6"
  930.             CALL PrintO(6)
  931.         CASE "X3O5X6O9X2", "X3O5X6O9X4", "X3O5X6O9X7", "X3O5X6O9X8"
  932.             gameString$ = gameString$ + "O1"
  933.             CALL PrintO(1)
  934.             CALL WinLine(diagTL)
  935.         CASE "X3O5X6O9X1" '***********
  936.             gameString$ = gameString$ + "O2"
  937.             CALL PrintO(2)
  938.         CASE "X3O5X7O2X1", "X3O5X7O2X4", "X3O5X7O2X6", "X3O5X7O2X9"
  939.             gameString$ = gameString$ + "O8"
  940.             CALL PrintO(8)
  941.             CALL WinLine(vertM)
  942.         CASE "X3O5X7O2X8" '*********
  943.             gameString$ = gameString$ + "O9"
  944.             CALL PrintO(9)
  945.         CASE "X3O5X8O9X2", "X3O5X8O9X4", "X3O5X8O9X6", "X3O5X8O9X7"
  946.             gameString$ = gameString$ + "O1"
  947.             CALL PrintO(1)
  948.             CALL WinLine(diagTL)
  949.         CASE "X3O5X8O9X1" '************
  950.             gameString$ = gameString$ + "O2"
  951.             CALL PrintO(2)
  952.         CASE "X3O5X9O6X1", "X3O5X9O6X2", "X3O5X9O6X7", "X3O5X9O6X8"
  953.             gameString$ = gameString$ + "O4"
  954.             CALL PrintO(4)
  955.             CALL WinLine(acrossMid)
  956.         CASE "X3O5X9O6X4" '*******
  957.             gameString$ = gameString$ + "O2"
  958.             CALL PrintO(2)
  959.     END SELECT
  960.     playerMove = GetLocation
  961.     gameString$ = gameString$ + "X" + S$(playerMove)
  962.     SELECT CASE gameString$
  963.         CASE "X3O5X1O2X8O4X7", "X3O5X1O2X8O4X9"
  964.             gameString$ = gameString$ + "O6"
  965.             CALL PrintO(6)
  966.             CALL WinLine(acrossMid)
  967.         CASE "X3O5X1O2X8O4X6"
  968.             gameString$ = gameString$ + "O9"
  969.             CALL PrintO(9)
  970.         CASE "X3O5X2O1X9O6X7", "X3O5X2O1X9O6X8"
  971.             gameString$ = gameString$ + "O4"
  972.             CALL PrintO(4)
  973.             CALL WinLine(acrossMid)
  974.         CASE "X3O5X2O1X9O6X4"
  975.             gameString$ = gameString$ + "O7"
  976.             CALL PrintO(7)
  977.         CASE "X3O5X4O1X9O6X2", "X3O5X4O1X9O6X7"
  978.             gameString$ = gameString$ + "O8"
  979.             CALL PrintO(8)
  980.         CASE "X3O5X4O1X9O6X8"
  981.             gameString$ = gameString$ + "O7"
  982.             CALL PrintO(7)
  983.         CASE "X3O5X6O9X1O2X4", "X3O5X6O9X1O2X7"
  984.             gameString$ = gameString$ + "O8"
  985.             CALL PrintO(8)
  986.             CALL WinLine(vertM)
  987.         CASE "X3O5X6O9X1O2X8"
  988.             gameString$ = gameString$ + "O4"
  989.             CALL PrintO(4)
  990.         CASE "X3O5X7O2X8O9X4", "X3O5X7O2X8O9X6"
  991.             gameString$ = gamest5ring$ + "O1"
  992.             CALL PrintO(1)
  993.             CALL WinLine(diagTL)
  994.         CASE "X3O5X7O2X8O9X1"
  995.             gameString$ = gameString$ + "O4"
  996.             CALL PrintO(4)
  997.         CASE "X3O5X8O9X1O2X4", "X3O5X8O9X1O2X6"
  998.             gameString$ = gameString$ + "O7"
  999.             CALL PrintO(7)
  1000.         CASE "X3O5X8O9X1O2X7"
  1001.             gameString$ = gameString$ + "O4"
  1002.             CALL PrintO(4)
  1003.         CASE "X3O5X9O6X4O2X1", "X3O5X9O6X4O2X7"
  1004.             gameString$ = gameString$ + "O8"
  1005.             CALL PrintO(8)
  1006.             CALL WinLine(vertM)
  1007.         CASE "X3O5X9O6X4O2X8"
  1008.             gameString$ = gameString$ + "O7"
  1009.             CALL PrintO(7)
  1010.     END SELECT
  1011.     playerMove = GetLocation
  1012.     gameString$ = gameString$ + "X" + S$(playerMove)
  1013.  
  1014.  
  1015. SUB X4
  1016.     gameString$ = gameString$ + "O5"
  1017.     CALL PrintO(5)
  1018.     playerMove = GetLocation
  1019.     gameString$ = gameString$ + "X" + S$(playerMove)
  1020.     SELECT CASE gameString$
  1021.         CASE "X4O5X1"
  1022.             gameString$ = gameString$ + "O7"
  1023.             CALL PrintO(7)
  1024.         CASE "X4O5X2"
  1025.             gameString$ = gameString$ + "O1"
  1026.             CALL PrintO(1)
  1027.         CASE "X4O5X3"
  1028.             gameString$ = gameString$ + "O1"
  1029.             CALL PrintO(1)
  1030.         CASE "X4O5X6"
  1031.             gameString$ = gameString$ + "O1"
  1032.             CALL PrintO(1)
  1033.         CASE "X4O5X7"
  1034.             gameString$ = gameString$ + "O1"
  1035.             CALL PrintO(1)
  1036.         CASE "X4O5X8"
  1037.             gameString$ = gameString$ + "O7"
  1038.             CALL PrintO(7)
  1039.         CASE "X4O5X9"
  1040.             gameString$ = gameString$ + "O7"
  1041.             CALL PrintO(7)
  1042.     END SELECT
  1043.     playerMove = GetLocation
  1044.     gameString$ = gameString$ + "X" + S$(playerMove)
  1045.     SELECT CASE gameString$
  1046.         CASE "X4O5X1O7X2", "X4O5X1O7X6", "X4O5X1O7X8", "X4O5X1O7X9"
  1047.             gameString$ = gameString$ + "O3"
  1048.             CALL PrintO(3)
  1049.             CALL WinLine(diagBL)
  1050.         CASE "X4O5X1O7X3" '***********
  1051.             gameString$ = gameString$ + "O2"
  1052.             CALL PrintO(2)
  1053.         CASE "X4O5X2O1X3", "X4O5X2O1X6", "X4O5X2O1X7", "X4O5X2O1X8"
  1054.             gameString$ = gameString$ + "O9"
  1055.             CALL PrintO(9)
  1056.             CALL WinLine(diagTL)
  1057.         CASE "X4O5X2O1X9" '*************
  1058.             gameString$ = gameString$ + "O3"
  1059.             CALL PrintO(3)
  1060.         CASE "X4O5X3O1X2", "X4O5X3O1X6", "X4O5X3O1X7", "X4O5X3O1X8"
  1061.             gameString$ = gameString$ + "O9"
  1062.             CALL PrintO(9)
  1063.             CALL WinLine(diagTL)
  1064.         CASE "X4O5X3O1X9" '**************
  1065.             gameString$ = gameString$ + "O6"
  1066.             CALL PrintO(6)
  1067.         CASE "X4O5X6O1X2", "X4O5X6O1X3", "X4O5X6O1X7", "X4O5X6O1X8"
  1068.             gameString$ = gameString$ + "O9"
  1069.             CALL PrintO(9)
  1070.             CALL WinLine(diagTL)
  1071.         CASE "X4O5X6O1X9" '****************
  1072.             gameString$ = gameString$ + "O3"
  1073.             CALL PrintO(3)
  1074.         CASE "X4O5X7O1X2", "X4O5X7O1X3", "X4O5X7O1X6", "X4O5X7O1X8"
  1075.             gameString$ = gameString$ + "O9"
  1076.             CALL PrintO(9)
  1077.             CALL WinLine(diagTL)
  1078.         CASE "X4O5X7O1X9" '********************
  1079.             gameString$ = gameString$ + "O8"
  1080.             CALL PrintO(8)
  1081.         CASE "X4O5X8O7X1", "X4O5X8O7X2", "X4O5X8O7X6", "X4O5X8O7X9"
  1082.             gameString$ = gameString$ + "O3"
  1083.             CALL PrintO(3)
  1084.             CALL WinLine(diagBL)
  1085.         CASE "X4O5X8O7X3" '********************
  1086.             gameString$ = gameString$ + "O1"
  1087.             CALL PrintO(1)
  1088.         CASE "X4O5X9O7X1", "X4O5X9O7X2", "X4O5X9O7X6", "X4O5X9O7X8"
  1089.             gameString$ = gameString$ + "O3"
  1090.             CALL PrintO(3)
  1091.             CALL WinLine(diagBL)
  1092.         CASE "X4O5X9O7X3" '****************
  1093.             gameString$ = gameString$ + "O6"
  1094.             CALL PrintO(6)
  1095.     END SELECT
  1096.     playerMove = GetLocation
  1097.     gameString$ = gameString$ + "X" + S$(playerMove)
  1098.     SELECT CASE gameString$
  1099.         CASE "X4O5X1O7X3O2X6", "X4O5X1O7X3O2X9"
  1100.             gameString$ = gameString$ + "O8"
  1101.             CALL PrintO(8)
  1102.             CALL WinLine(vertM)
  1103.         CASE "X4O5X1O7X3O2X8"
  1104.             gameString$ = gameString$ + "O6"
  1105.             CALL PrintO(6)
  1106.         CASE "X4O5X2O1X9O3X6", "X4O5X2O1X9O3X8"
  1107.             gameString$ = gameString$ + "O7"
  1108.             CALL PrintO(7)
  1109.             CALL WinLine(diagBL)
  1110.         CASE "X4O5X2O1X9O3X7"
  1111.             gameString$ = gameString$ + "O8"
  1112.             CALL PrintO(8)
  1113.         CASE "X4O5X3O1X9O6X2", "X4O5X3O1X9O6X7"
  1114.             gameString$ = gameString$ + "O8"
  1115.             CALL PrintO(8)
  1116.         CASE "X4O5X3O1X9O6X8"
  1117.             gameString$ = gameString$ + "O7"
  1118.             CALL PrintO(7)
  1119.         CASE "X4O5X6O1X9O3X2", "X4O5X6O1X9O3X8"
  1120.             gameString$ = gameString$ + "O7"
  1121.             CALL PrintO(7)
  1122.             CALL WinLine(diagBL)
  1123.         CASE "X4O5X6O1X9O3X7"
  1124.             gameString$ = gameString$ + "O2"
  1125.             CALL PrintO(2)
  1126.             CALL WinLine(acrossTop)
  1127.         CASE "X4O5X7O1X9O8X3", "X4O5X7O1X9O8X6"
  1128.             gameString$ = gameString$ + "O2"
  1129.             CALL PrintO(2)
  1130.             CALL WinLine(vertM)
  1131.         CASE "X4O5X7O1X9O8X2"
  1132.             gameString$ = gameString$ + "O3"
  1133.             CALL PrintO(3)
  1134.         CASE "X4O5X8O7X3O1X2", "X4O5X8O7X3O1X6"
  1135.             gameString$ = gameString$ + "O9"
  1136.             CALL PrintO(9)
  1137.             CALL WinLine(diagTL)
  1138.         CASE "X4O5X8O7X3O1X9"
  1139.             gameString$ = gameString$ + "O6"
  1140.             CALL PrintO(6)
  1141.         CASE "X4O5X9O7X3O6X1", "X4O5X9O7X3O6X8"
  1142.             gameString$ = gameString$ + "O2"
  1143.             CALL PrintO(2)
  1144.         CASE "X4O5X9O7X3O6X2"
  1145.             gameString$ = gameString$ + "O1"
  1146.             CALL PrintO(1)
  1147.     END SELECT
  1148.     playerMove = GetLocation
  1149.     gameString$ = gameString$ + "X" + S$(playerMove)
  1150.  
  1151. SUB X5
  1152.     gameString$ = gameString$ + "O1"
  1153.     CALL PrintO(1)
  1154.     playerMove = GetLocation
  1155.     gameString$ = gameString$ + "X" + S$(playerMove)
  1156.     SELECT CASE gameString$
  1157.         CASE "X5O1X2"
  1158.             gameString$ = gameString$ + "O8"
  1159.             CALL PrintO(8)
  1160.         CASE "X5O1X3"
  1161.             gameString$ = gameString$ + "O7"
  1162.             CALL PrintO(7)
  1163.         CASE "X5O1X4"
  1164.             gameString$ = gameString$ + "O6"
  1165.             CALL PrintO(6)
  1166.         CASE "X5O1X6"
  1167.             gameString$ = gameString$ + "O4"
  1168.             CALL PrintO(4)
  1169.         CASE "X5O1X7"
  1170.             gameString$ = gameString$ + "O3"
  1171.             CALL PrintO(3)
  1172.         CASE "X5O1X8"
  1173.             gameString$ = gameString$ + "O2"
  1174.             CALL PrintO(2)
  1175.         CASE "X5O1X9"
  1176.             gameString$ = gameString$ + "O3"
  1177.             CALL PrintO(3)
  1178.     END SELECT
  1179.     playerMove = GetLocation
  1180.     gameString$ = gameString$ + "X" + S$(playerMove)
  1181.     SELECT CASE gameString$
  1182.         'X5O1X2O8X
  1183.         CASE "X5O1X2O8X3"
  1184.             gameString$ = gameString$ + "O7"
  1185.             CALL PrintO(7)
  1186.         CASE "X5O1X2O8X4"
  1187.             gameString$ = gameString$ + "O6"
  1188.             CALL PrintO(6)
  1189.         CASE "X5O1X2O8X6"
  1190.             gameString$ = gameString$ + "O4"
  1191.             CALL PrintO(4)
  1192.         CASE "X5O1X2O8X7"
  1193.             gameString$ = gameString$ + "O3"
  1194.             CALL PrintO(3)
  1195.         CASE "X5O1X2O8X9"
  1196.             gameString$ = gameString$ + "O4"
  1197.             CALL PrintO(4)
  1198.             ' X5O1X3O7X
  1199.         CASE "X5O1X3O7X2", "X5O1X3O7X6", "X5O1X3O7X8", "X5O1X3O7X9"
  1200.             gameString$ = gameString$ + "O4"
  1201.             CALL PrintO(4)
  1202.             CALL WinLine(vertL)
  1203.         CASE "X5O1X3O7X4"
  1204.             gameString$ = gameString$ + "O6"
  1205.             CALL PrintO(6)
  1206.             '"X5O1X4O6X
  1207.         CASE "X5O1X4O6X2", "X5O1X4O6X9"
  1208.             gameString$ = gameString$ + "O8"
  1209.             CALL PrintO(8)
  1210.         CASE "X5O1X4O6X3"
  1211.             gameString$ = gameString$ + "O7"
  1212.             CALL PrintO(7)
  1213.         CASE "X5O1X4O6X7"
  1214.             gameString$ = gameString$ + "O3"
  1215.             CALL PrintO(3)
  1216.         CASE "X5O1X4O6X8"
  1217.             gameString$ = gameString$ + "O2"
  1218.             CALL PrintO(2)
  1219.         CASE "X5O1X6O4X2", "X5O1X6O4X3", "X5O1X6O4X8", "X5O1X6O4X9"
  1220.             gameString$ = gameString$ + "O7"
  1221.             CALL PrintO(7)
  1222.             CALL WinLine(vertL)
  1223.         CASE "X5O1X6O4X7"
  1224.             gameString$ = gameString$ + "O3"
  1225.             CALL PrintO(3)
  1226.         CASE "X5O1X7O3X4", "X5O1X7O3X6", "X5O1X7O3X8", "X5O1X7O3X9"
  1227.             gameString$ = gameString$ + "O2"
  1228.             CALL PrintO(2)
  1229.             CALL WinLine(acrossTop)
  1230.         CASE "X5O1X7O3X2"
  1231.             gameString$ = gameString$ + "O8"
  1232.             CALL PrintO(8)
  1233.         CASE "X5O1X8O2X4", "X5O1X8O2X6", "X5O1X8O2X7", "X5O1X8O2X9"
  1234.             gameString$ = gameString$ + "O3"
  1235.             CALL PrintO(3)
  1236.             CALL WinLine(acrossTop)
  1237.         CASE "X5O1X8O2X3"
  1238.             gameString$ = gameString$ + "O7"
  1239.             CALL PrintO(7)
  1240.         CASE "X5O1X9O3X4", "X5O1X9O3X6", "X5O1X9O3X7", "X5O1X9O3X8"
  1241.             gameString$ = gameString$ + "O2"
  1242.             CALL PrintO(2)
  1243.             CALL WinLine(acrossTop)
  1244.         CASE "X5O1X9O3X2"
  1245.             gameString$ = gameString$ + "O8"
  1246.             CALL PrintO(8)
  1247.     END SELECT
  1248.     playerMove = GetLocation
  1249.     gameString$ = gameString$ + "X" + S$(playerMove)
  1250.     SELECT CASE gameString$
  1251.         CASE "X5O1X2O8X3O7X4", "X5O1X2O8X3O7X6"
  1252.             gameString$ = gameString$ + "O9"
  1253.             CALL PrintO(9)
  1254.             CALL WinLine(acrossBot)
  1255.         CASE "X5O1X2O8X3O7X9"
  1256.             gameString$ = gameString$ + "O4"
  1257.             CALL PrintO(4)
  1258.             CALL WinLine(vertL)
  1259.         CASE "X5O1X2O8X4O6X3"
  1260.             gameString$ = gameString$ + "O7"
  1261.             CALL PrintO(7)
  1262.         CASE "X5O1X2O8X4O6X7", "X5O1X2O8X4O6X9"
  1263.             gameString$ = gameString$ + "O3"
  1264.             CALL PrintO(3)
  1265.         CASE "X5O1X2O8X6O4X3", "X5O1X2O8X6O4X9"
  1266.             gameString$ = gameString$ + "O7"
  1267.             CALL PrintO(7)
  1268.             CALL WinLine(vertL)
  1269.         CASE "X5O1X2O8X6O4X7"
  1270.             gameString$ = gameString$ + "O3"
  1271.             CALL PrintO(3)
  1272.         CASE "X5O1X2O8X7O3X4", "X5O1X2O8X7O3X9"
  1273.             gameString$ = gameString$ + "O6"
  1274.             CALL PrintO(6)
  1275.         CASE "X5O1X2O8X7O3X6"
  1276.             gameString$ = gameString$ + "O4"
  1277.             CALL PrintO(4)
  1278.         CASE "X5O1X2O8X9O4X3", "X5O1X2O8X9O4X6"
  1279.             gameString$ = gameString$ + "O7"
  1280.             CALL PrintO(7)
  1281.             CALL WinLine(vertL)
  1282.         CASE "X5O1X2O8X9O4X7"
  1283.             gameString$ = gameString$ + "O3"
  1284.             CALL PrintO(3)
  1285.         CASE "X5O1X3O7X4O6X2"
  1286.             gameString$ = gameString$ + "O8"
  1287.             CALL PrintO(8)
  1288.         CASE "X5O1X3O7X4O6X8", "X5O1X3O7X4O6X9"
  1289.             gameString$ = gamestgring$ + "O2"
  1290.             CALL PrintO(2)
  1291.         CASE "X5O1X4O6X2O8X3", "X5O1X4O6X2O8X9"
  1292.             gameString$ = gameString$ + "O7"
  1293.             CALL PrintO(7)
  1294.         CASE "X5O1X4O6X2O8X7"
  1295.             gameString$ = gameString$ + "O3"
  1296.             CALL PrintO(3)
  1297.         CASE "X5O1X4O6X3O7X2"
  1298.             gameString$ = gameString$ + "O8"
  1299.             CALL PrintO(8)
  1300.         CASE "X5O1X4O6X3O7X8", "X5O1X4O6X3O7X9"
  1301.             gameString$ = gameString$ + "O2"
  1302.             CALL PrintO(2)
  1303.         CASE "X5O1X4O6X7O3X2", "X5O1X4O6X7O3X8"
  1304.             gameString$ = gameString$ + "O9"
  1305.             CALL PrintO(9)
  1306.             CALL WinLine(vertR)
  1307.         CASE "X5O1X4O6X7O3X9"
  1308.             gameString$ = gameString$ + "O2"
  1309.             CALL PrintO(2)
  1310.             CALL WinLine(acrossTop)
  1311.         CASE "X5O1X4O6X8O2X3"
  1312.             gameString$ = gameString$ + "O7"
  1313.             CALL PrintO(7)
  1314.         CASE "X5O1X4O6X8O2X7", "X5O1X4O6X8O2X9"
  1315.             gameString$ = gameString$ + "O3"
  1316.             CALL PrintO(3)
  1317.             CALL WinLine(acrossTop)
  1318.         CASE "X5O1X4O6X9O8X2", "X5O1X4O6X9O8X7"
  1319.             gameString$ = gameString$ + "O3"
  1320.             CALL PrintO(3)
  1321.         CASE "X5O1X4O6X9O8X3"
  1322.             gameString$ = gameString$ + "O7"
  1323.             CALL PrintO(7)
  1324.         CASE "X5O1X6O4X7O3X8", "X5O1X6O4X7O3X9"
  1325.             gameString$ = gameString$ + "O2"
  1326.             CALL PrintO(2)
  1327.             CALL WinLine(acrossTop)
  1328.         CASE "X5O1X6O4X7O3X2"
  1329.             gameString$ = gameString$ + "O8"
  1330.             CALL PrintO(8)
  1331.         CASE "X5O1X7O3X2O8X6", "X5O1X7O3X2O8X9"
  1332.             gameString$ = gameString$ + "O4"
  1333.             CALL PrintO(4)
  1334.         CASE "X5O1X7O3X2O8X4"
  1335.             gameString$ = gameString$ + "O6"
  1336.             CALL PrintO(6)
  1337.         CASE "X5O1X8O2X3O7X6", "X5O1X8O2X3O7X9"
  1338.             gameString$ = gameString$ + "O4"
  1339.             CALL PrintO(4)
  1340.             CALL WinLine(vertL)
  1341.         CASE "X5O1X8O2X3O7X4"
  1342.             gameString$ = gameString$ + "O6"
  1343.             CALL PrintO(6)
  1344.         CASE "X5O1X9O3X2O8X4", "X5O1X9O3X2O8X7"
  1345.             gameString$ = gameString$ + "O6"
  1346.             CALL PrintO(6)
  1347.         CASE "X5O1X9O3X2O8X6"
  1348.             gameString$ = gameString$ + "O4"
  1349.             CALL PrintO(4)
  1350.     END SELECT
  1351.     playerMove = GetLocation
  1352.     gameString$ = gameString$ + "X" + S$(playerMove)
  1353.  
  1354.  
  1355. SUB X6
  1356.     gameString$ = gameString$ + "O5"
  1357.     CALL PrintO(5)
  1358.     playerMove = GetLocation
  1359.     gameString$ = gameString$ + "X" + S$(playerMove)
  1360.     CALL PrintX(playerMove)
  1361.     SELECT CASE gameString$
  1362.         CASE "X6O5X1"
  1363.             gameString$ = gameString$ + "O3"
  1364.             CALL PrintO(3)
  1365.         CASE "X6O5X2"
  1366.             gameString$ = gameString$ + "O3"
  1367.             CALL PrintO(3)
  1368.         CASE "X6O5X3"
  1369.             gameString$ = gameString$ + "O9"
  1370.             CALL PrintO(9)
  1371.         CASE "X6O5X4"
  1372.             gameString$ = gameString$ + "O3"
  1373.             CALL PrintO(3)
  1374.         CASE "X6O5X7"
  1375.             gameString$ = gameString$ + "O9"
  1376.             CALL PrintO(9)
  1377.         CASE "X6O5X8"
  1378.             gameString$ = gameString$ + "O9"
  1379.             CALL PrintO(9)
  1380.         CASE "X6O5X9"
  1381.             gameString$ = gameString$ + "O3"
  1382.             CALL PrintO(3)
  1383.     END SELECT
  1384.     playerMove = GetLocation
  1385.     gameString$ = gameString$ + "X" + S$(playerMove)
  1386.     CALL PrintX(playerMove)
  1387.     SELECT CASE gameString$
  1388.         CASE "X6O5X1O3X2", "X6O5X1O3X4", "X6O5X1O3X8", "X6O5X1O3X9"
  1389.             gameString$ = gameString$ + "O7"
  1390.             CALL PrintO(7)
  1391.             CALL WinLine(diagBL)
  1392.         CASE "X6O5X1O3X7"
  1393.             gameString$ = gameString$ + "O4"
  1394.             CALL PrintO(4)
  1395.         CASE "X6O5X2O3X1", "X6O5X2O3X4", "X6O5X2O3X8", "X6O5X2O3X9"
  1396.             gameString$ = gameString$ + "O7"
  1397.             CALL PrintO(7)
  1398.             CALL WinLine(diagBL)
  1399.         CASE "X6O5X2O3X7" '***********
  1400.             gameString$ = gameString$ + "O1"
  1401.             CALL PrintO(1)
  1402.         CASE "X6O5X3O9X2", "X6O5X3O9X4", "X6O5X3O9X7", "X6O5X3O9X8"
  1403.             gameString$ = gameString$ + "O1"
  1404.             CALL PrintO(1)
  1405.             CALL WinLine(diagTL)
  1406.         CASE "X6O5X3O9X1"
  1407.             gameString$ = gameString$ + "O2"
  1408.             CALL PrintO(2)
  1409.         CASE "X6O5X4O3X1", "X6O5X4O3X2", "X6O5X4O3X8", "X6O5X4O3X9"
  1410.             gameString$ = gameString$ + "O7"
  1411.             CALL PrintO(7)
  1412.             CALL WinLine(diagBL)
  1413.         CASE "X6O5X4O3X7" '********************
  1414.             gameString$ = gameString$ + "O1"
  1415.             CALL PrintO(1)
  1416.         CASE "X6O5X7O9X2", "X6O5X7O9X3", "X6O5X7O9X4", "X6O5X7O9X8"
  1417.             gameString$ = gameString$ + "O1"
  1418.             CALL PrintO(1)
  1419.             CALL WinLine(diagTL)
  1420.         CASE "X6O5X7O9X1" '**********************
  1421.             gameString$ = gameString$ + "O4"
  1422.             CALL PrintO(4)
  1423.         CASE "X6O5X8O9X2", "X6O5X8O9X3", "X6O5X8O9X4", "X6O5X8O9X7"
  1424.             gameString$ = gameString$ + "O1"
  1425.             CALL PrintO(1)
  1426.             CALL WinLine(diagTL)
  1427.         CASE "X6O5X8O9X1" '******************************
  1428.             gameString$ = gameString$ + "O3"
  1429.             CALL PrintO(3)
  1430.         CASE "X6O5X9O3X1", "X6O5X9O3X2", "X6O5X9O3X4", "X6O5X9O3X8"
  1431.             gameString$ = gameString$ + "O7"
  1432.             CALL PrintO(7)
  1433.             CALL WinLine(diagBL)
  1434.         CASE "X6O5X9O3X7"
  1435.             gameString$ = gameString$ + "O8"
  1436.             CALL PrintO(8)
  1437.     END SELECT
  1438.     playerMove = GetLocation
  1439.     gameString$ = gameString$ + "X" + S$(playerMove)
  1440.     CALL PrintX(playerMove)
  1441.     SELECT CASE gameString$
  1442.         CASE "X6O5X1O3X7O4X2", "X6O5X1O3X7O4X8"
  1443.             gameString$ = gameString$ + "O9"
  1444.             CALL PrintO(9)
  1445.         CASE "X6O5X1O3X7O4X9"
  1446.             gameString$ = gameString$ + "O8"
  1447.             CALL PrintO(8)
  1448.         CASE "X6O5X2O3X7O1X4", "X6O5X2O3X7O1X8"
  1449.             gameString$ = gameString$ + "O9"
  1450.             CALL PrintO(9)
  1451.             CALL WinLine(diagTL)
  1452.         CASE "X6O5X2O3X7O1X9"
  1453.             gameString$ = gameString$ + "4"
  1454.             CALL PrintO(4)
  1455.         CASE "X6O5X3O9X1O2X4", "X6O5X3O9X1O2X7"
  1456.             gameString$ = gameString$ + "O8"
  1457.             CALL PrintO(8)
  1458.             CALL WinLine(vertM)
  1459.         CASE "X6O5X3O9X1O2X8"
  1460.             gameString$ = gameString$ + "O4"
  1461.             CALL PrintO(4)
  1462.         CASE "X6O5X4O3X7O1X2", "X6O5X4O3X7O1X8"
  1463.             gameString$ = gameString$ + "O9"
  1464.             CALL PrintO(9)
  1465.             CALL WinLine(diagTL)
  1466.         CASE "X6O5X4O3X7O1X9"
  1467.             gameString$ = gameString$ + "O2"
  1468.             CALL PrintO(2)
  1469.             CALL WinLine(acrossTop)
  1470.         CASE "X6O5X7O9X1O4X2", "X6O5X7O9X1O4X8"
  1471.             gameString$ = gameString$ + "O3"
  1472.             CALL PrintO(3)
  1473.         CASE "X6O5X7O9X1O4X3"
  1474.             gameString$ = gameString$ + "O2"
  1475.             CALL PrintO(2)
  1476.         CASE "X6O5X8O9X1O3X2", "X6O5X8O9X1O3X4"
  1477.             gameString$ = gameString$ + "O7"
  1478.             CALL PrintO(7)
  1479.             CALL WinLine(diagBL)
  1480.         CASE "X6O5X8O9X1O3X7"
  1481.             gameString$ = gameString$ + "O4"
  1482.             CALL PrintO(4)
  1483.         CASE "X6O5X9O3X7O8X1", "X6O5X9O3X7O8X4"
  1484.             gameString$ = gameString$ + "O2"
  1485.             CALL PrintO(2)
  1486.             CALL WinLine(vertM)
  1487.         CASE "X6O5X9O3X7O8X2"
  1488.             gameString$ = gameString$ + "O1"
  1489.             CALL PrintO(1)
  1490.     END SELECT
  1491.     playerMove = GetLocation
  1492.     gameString$ = gameString$ + "X" + S$(playerMove)
  1493.  
  1494.  
  1495. SUB X7
  1496.     gameString$ = gameString$ + "O5"
  1497.     CALL PrintO(5)
  1498.     playerMove = GetLocation
  1499.     gameString$ = gameString$ + "X" + S$(playerMove)
  1500.     CALL PrintX(playerMove)
  1501.     SELECT CASE gameString$
  1502.         CASE "X7O5X1"
  1503.             gameString$ = gameString$ + "O4"
  1504.             CALL PrintO(4)
  1505.         CASE "X7O5X2"
  1506.             gameString$ = gameString$ + "O1"
  1507.             CALL PrintO(1)
  1508.         CASE "X7O5X3"
  1509.             gameString$ = gameString$ + "O2"
  1510.             CALL PrintO(2)
  1511.         CASE "X7O5X4"
  1512.             gameString$ = gameString$ + "O1"
  1513.             CALL PrintO(1)
  1514.         CASE "X7O5X6"
  1515.             gameString$ = gameString$ + "O9"
  1516.             CALL PrintO(9)
  1517.         CASE "X7O5X8"
  1518.             gameString$ = gameString$ + "O9"
  1519.             CALL PrintO(9)
  1520.         CASE "X7O5X9"
  1521.             gameString$ = gameString$ + "O8"
  1522.             CALL PrintO(8)
  1523.     END SELECT
  1524.     playerMove = GetLocation
  1525.     gameString$ = gameString$ + "X" + S$(playerMove)
  1526.     CALL PrintX(playerMove)
  1527.     SELECT CASE gameString$
  1528.         CASE "X7O5X1O4X2", "X7O5X1O4X3", "X7O5X1O4X8", "X7O5X1O4X9"
  1529.             gameString$ = gameString$ + "O6"
  1530.             CALL PrintO(6)
  1531.             CALL WinLine(acrossMid)
  1532.         CASE "X7O5X1O4X6" '**********************
  1533.             gameString$ = gameString$ + "O2"
  1534.             CALL PrintO(2)
  1535.         CASE "X7O5X2O1X3", "X7O5X2O1X4", "X7O5X2O1X6", "X7O5X2O1X8"
  1536.             gameString$ = gameString$ + "O9"
  1537.             CALL PrintO(9)
  1538.             CALL WinLine(diagTL)
  1539.         CASE "X7O5X2O1X9" '****************************
  1540.             gameString$ = gameString$ + "O8"
  1541.             CALL PrintO(8)
  1542.         CASE "X7O5X3O2X1", "X7O5X3O2X4", "X7O5X3O2X6", "X7O5X3O2X9"
  1543.             gameString$ = gameString$ + "O8"
  1544.             CALL PrintO(8)
  1545.             CALL WinLine(vertM)
  1546.         CASE "X7O5X3O2X8" '*******************
  1547.             gameString$ = gameString$ + "O9"
  1548.             CALL PrintO(9)
  1549.         CASE "X7O5X4O1X2", "X7O5X4O1X3", "X7O5X4O1X6", "X7O5X4O1X8"
  1550.             gameString$ = gameString$ + "O9"
  1551.             CALL PrintO(9)
  1552.             CALL WinLine(diagTL)
  1553.         CASE "X7O5X4O1X9" '**********************
  1554.             gameString$ = gameString$ + "O8"
  1555.             CALL PrintO(8)
  1556.         CASE "X7O5X6O9X2", "X7O5X6O9X3", "X7O5X6O9X4", "X7O5X6O9X8"
  1557.             gameString$ = gameString$ + "O1"
  1558.             CALL PrintO(1)
  1559.             CALL WinLine(diagTL)
  1560.         CASE "X7O5X6O9X1" '******************
  1561.             gameString$ = gameString$ + "O4"
  1562.             CALL PrintO(4)
  1563.         CASE "X7O5X8O9X2", "X7O5X8O9X3", "X7O5X8O9X4", "X7O5X8O9X6"
  1564.             gameString$ = gameString$ + "O1"
  1565.             CALL PrintO(1)
  1566.             CALL WinLine(diagTL)
  1567.         CASE "X7O5X8O9X1" '******************
  1568.             gameString$ = gameString$ + "O4"
  1569.             CALL PrintO(4)
  1570.         CASE "X7O5X9O8X1", "X7O5X9O8X3", "X7O5X9O8X4", "X7O5X9O8X6"
  1571.             gameString$ = gameString$ + "O2"
  1572.             CALL PrintO(2)
  1573.             CALL WinLine(vertM)
  1574.         CASE "X7O5X9O8X2"
  1575.             gameString$ = gameString$ + "O4"
  1576.             CALL PrintO(4)
  1577.     END SELECT
  1578.     playerMove = GetLocation
  1579.     gameString$ = gameString$ + "X" + S$(playerMove)
  1580.     CALL PrintX(playerMove)
  1581.     '    color 15,0:locate 45,10:?gamestring$:call p(true)
  1582.     SELECT CASE gameString$
  1583.         CASE "X7O5X1O4X6O2X3", "X7O5X1O4X6O2X9"
  1584.             gameString$ = gameString$ + "O8"
  1585.             CALL PrintO(8)
  1586.             CALL WinLine(vertM)
  1587.         CASE "X7O5X1O4X6O2X8"
  1588.             gameString$ = gameString$ + "O9"
  1589.             CALL PrintO(9)
  1590.         CASE "X7O5X2O1X9O8X3", "X7O5X2O1X9O8X4"
  1591.             gameString$ = gameString$ + "O6"
  1592.             CALL PrintO(6)
  1593.         CASE "X7O5X2O1X9O8X6"
  1594.             gameString$ = gameString$ + "O3"
  1595.             CALL PrintO(3)
  1596.         CASE "X7O5X3O2X8O9X4", "X7O5X3O2X8O9X6"
  1597.             gameString$ = gameString$ + "O1"
  1598.             CALL PrintO(1)
  1599.             CALL WinLine(diagTL)
  1600.         CASE "X7O5X3O2X8O9X1"
  1601.             gameString$ = gameString$ + "O4"
  1602.             CALL PrintO(4)
  1603.         CASE "X7O5X4O1X9O8X3", "X7O5X4O1X9O8X6"
  1604.             gameString$ = gameString$ + "O2"
  1605.             CALL PrintO(2)
  1606.             CALL WinLine(vertM)
  1607.         CASE "X7O5X4O1X9O8X2"
  1608.             gameString$ = gameString$ + "O3"
  1609.             CALL PrintO(3)
  1610.         CASE "X7O5X6O9X1O4X2", "X7O5X6O9X1O4X8"
  1611.             gameString$ = gameString$ + "O3"
  1612.             CALL PrintO(3)
  1613.         CASE "X7O5X6O9X1O4X3"
  1614.             gameString$ = gameString$ + "O2"
  1615.             CALL PrintO(2)
  1616.         CASE "X7O5X8O9X1O4X2", "X7O5X8O9X1O4X3"
  1617.             gameString$ = gameString$ + "O6"
  1618.             CALL PrintO(6)
  1619.             CALL WinLine(acrossMid)
  1620.         CASE "X7O5X8O9X1O4X6"
  1621.             gameString$ = gameString$ + "O2"
  1622.             CALL PrintO(2)
  1623.         CASE "X7O5X9O8X2O4X1", "X7O5X9O8X2O4X3"
  1624.             gameString$ = gameString$ + "O6"
  1625.             CALL PrintO(6)
  1626.             CALL WinLine(acrossMid)
  1627.         CASE "X7O5X9O8X2O4X6"
  1628.             gameString$ = gameString$ + "O3"
  1629.             CALL PrintO(3)
  1630.         CASE "X7O5X6O9X1O4X2", "X7O5X6O9X1O4X8"
  1631.             gameString$ = gameString$ + "O3"
  1632.             CALL PrintO(3)
  1633.         CASE "X7O5X6O9X1O4X3"
  1634.             gameString$ = gameString$ + "O2"
  1635.             CALL PrintO(2)
  1636.     END SELECT
  1637.     playerMove = GetLocation
  1638.     gameString$ = gameString$ + "X" + S$(playerMove)
  1639.     CALL PrintX(playerMove)
  1640.  
  1641. SUB X8
  1642.     gameString$ = gameString$ + "O5"
  1643.     CALL PrintO(5)
  1644.     playerMove = GetLocation
  1645.     gameString$ = gameString$ + "X" + S$(playerMove)
  1646.     CALL PrintX(playerMove)
  1647.     SELECT CASE gameString$
  1648.         CASE "X8O5X1"
  1649.             gameString$ = gameString$ + "O4"
  1650.             CALL PrintO(4)
  1651.         CASE "X8O5X2"
  1652.             gameString$ = gameString$ + "O7"
  1653.             CALL PrintO(7)
  1654.         CASE "X8O5X3"
  1655.             gameString$ = gameString$ + "O6"
  1656.             CALL PrintO(6)
  1657.         CASE "X8O5X4"
  1658.             gameString$ = gameString$ + "O7"
  1659.             CALL PrintO(7)
  1660.         CASE "X8O5X6"
  1661.             gameString$ = gameString$ + "O9"
  1662.             CALL PrintO(9)
  1663.         CASE "X8O5X7"
  1664.             gameString$ = gameString$ + "O9"
  1665.             CALL PrintO(9)
  1666.         CASE "X8O5X9"
  1667.             gameString$ = gameString$ + "O7"
  1668.             CALL PrintO(7)
  1669.     END SELECT
  1670.     playerMove = GetLocation
  1671.     gameString$ = gameString$ + "X" + S$(playerMove)
  1672.     CALL PrintX(playerMove)
  1673.     SELECT CASE gameString$
  1674.         CASE "X8O5X1O4X2", "X8O5X1O4X3", "X8O5X1O4X7", "X8O5X1O4X9"
  1675.             gameString$ = gameString$ + "O6"
  1676.             CALL PrintO(6)
  1677.             CALL WinLine(acrossMid)
  1678.         CASE "X8O5X1O4X6" '**********
  1679.             gameString$ = gameString$ + "O3"
  1680.             CALL PrintO(3)
  1681.         CASE "X8O5X2O7X1", "X8O5X2O7X4", "X8O5X2O7X6", "X8O5X2O7X9"
  1682.             gameString$ = gameString$ + "O3"
  1683.             CALL PrintO(3)
  1684.             CALL WinLine(diagBL)
  1685.         CASE "X8O5X2O7X3" '******************
  1686.             gameString$ = gameString$ + "O1"
  1687.             CALL PrintO(1)
  1688.         CASE "X8O5X3O6X1", "X8O5X3O6X2", "X8O5X3O6X7", "X8O5X3O6X9"
  1689.             gameString$ = gameString$ + "O4"
  1690.             CALL PrintO(4)
  1691.             CALL WinLine(acrossMid)
  1692.         CASE "X8O5X3O6X4" '&&&&&&&&&T
  1693.             gameString$ = gameString$ + "O1"
  1694.             CALL PrintO(1)
  1695.         CASE "X8O5X4O7X1", "X8O5X4O7X2", "X8O5X4O7X6", "X8O5X4O7X9"
  1696.             gameString$ = gameString$ + "O3"
  1697.             CALL PrintO(3)
  1698.             CALL WinLine(diagBL)
  1699.         CASE "X8O5X4O7X3" 'ERRRRRRRRRRRRRR
  1700.             gameString$ = gameString$ + "O1"
  1701.             CALL PrintO(1)
  1702.         CASE "X8O5X6O9X2", "X8O5X6O9X3", "X8O5X6O9X4", "X8O5X6O9X7"
  1703.             gameString$ = gameString$ + "O1"
  1704.             CALL PrintO(1)
  1705.             CALL WinLine(diagTL)
  1706.         CASE "X8O5X6O9X1" ' *(*******************
  1707.             gameString$ = gameString$ + "O7"
  1708.             CALL PrintO(7)
  1709.         CASE "X8O5X7O9X2", "X8O5X7O9X3", "X8O5X7O9X4", "X8O5X7O9X6"
  1710.             gameString$ = gamest4ring$ + "O1"
  1711.             CALL PrintO(1)
  1712.             CALL WinLine(diagTL)
  1713.         CASE "X8O5X7O9X1" '*************
  1714.             gameString$ = gameString$ + "O4"
  1715.             CALL PrintO(4)
  1716.         CASE "X8O5X9O7X1", "X8O5X9O7X2", "X8O5X9O7X4", "X8O5X9O7X6"
  1717.             gameString$ = gameString$ + "O3"
  1718.             CALL PrintO(3)
  1719.             CALL WinLine(diagBL)
  1720.         CASE "X8O5X9O7X3" '''''''''''''''''
  1721.             gameString$ = gameString$ + "O6"
  1722.             CALL PrintO(6)
  1723.     END SELECT
  1724.     playerMove = GetLocation
  1725.     gameString$ = gameString$ + "X" + S$(playerMove)
  1726.     CALL PrintX(playerMove)
  1727.     SELECT CASE gameString$
  1728.         CASE "X8O5X1O4X6O3X2", "X8O5X1O4X6O3X9"
  1729.             gameString$ = gameString$ + "O7"
  1730.             CALL PrintO(7)
  1731.             CALL WinLine(diagBL)
  1732.         CASE "X8O5X1O4X6O3X7"
  1733.             gameString$ = gameString$ + "O9"
  1734.             CALL PrintO(9)
  1735.         CASE "X8O5X2O7X3O1X4", "X8O5X2O7X3O1X6"
  1736.             gameString$ = gameString$ + "O9"
  1737.             CALL PrintO(9)
  1738.             CALL WinLine(diagTL)
  1739.         CASE "X8O5X2O7X3O1X9"
  1740.             gameString$ = gameString$ + "O4"
  1741.             CALL PrintO(4)
  1742.             CALL WinLine(vertL)
  1743.         CASE "X8O5X3O6X4O1X2", "X8O5X3O6X4O1X7"
  1744.             gameString$ = gameString$ + "O9"
  1745.             CALL PrintO(9)
  1746.             CALL WinLine(diagTL)
  1747.         CASE "X8O5X3O6X4O1X9"
  1748.             gameString$ = gameString$ + "O7"
  1749.             CALL PrintO(7)
  1750.         CASE "X8O5X4O7X3O1X2", "X8O5X4O7X3O1X6"
  1751.             gameString$ = gameString$ + "O9"
  1752.             CALL PrintO(9)
  1753.             CALL WinLine(diagTL)
  1754.         CASE "X8O5X4O7X3O1X9"
  1755.             gameString$ = gameString$ + "O2"
  1756.             CALL PrintO(2)
  1757.         CASE "X8O5X6O9X1O7X2", "X8O5X6O9X1O7X4"
  1758.             gameString$ = gameString$ + "O3"
  1759.             CALL PrintO(3)
  1760.             CALL WinLine(diagBL)
  1761.         CASE "X8O5X6O9X1O7X3"
  1762.             gameString$ = gameString$ + "O2"
  1763.             CALL PrintO(2)
  1764.         CASE "X8O5X7O9X1O4X3", "X8O5X7O9X1O4X2"
  1765.             gamestreing$ = gameString$ + "O6"
  1766.             CALL PrintO(6)
  1767.             CALL WinLine(acrossMid)
  1768.         CASE "X8O5X7O9X1O4X6"
  1769.             gameString$ = gameString$ + "O2"
  1770.             CALL PrintO(2)
  1771.         CASE "X8O5X9O7X3O6X1", "X8O5X9O7X3O6X2"
  1772.             gameString$ = gameString$ + "O4"
  1773.             CALL PrintO(4)
  1774.             CALL WinLine(acrossMid)
  1775.         CASE "X8O5X9O7X3O6X4"
  1776.             gameString$ = gameString$ + "O1"
  1777.             CALL PrintO(1)
  1778.     END SELECT
  1779.     playerMove = GetLocation
  1780.     gameString$ = gameString$ + "X" + S$(playerMove)
  1781.     CALL PrintX(playerMove)
  1782.  
  1783. SUB X9
  1784.     gameString$ = gameString$ + "O5"
  1785.     CALL PrintO(5)
  1786.     playerMove = GetLocation
  1787.     gameString$ = gameString$ + "X" + S$(playerMove)
  1788.     CALL PrintX(playerMove)
  1789.     SELECT CASE gameString$
  1790.         CASE "X9O5X1"
  1791.             gameString$ = gameString$ + "O2"
  1792.             CALL PrintO(2)
  1793.         CASE "X9O5X2"
  1794.             gameString$ = gameString$ + "O4"
  1795.             CALL PrintO(4)
  1796.         CASE "X9O5X3"
  1797.             gameString$ = gameString$ + "O6"
  1798.             CALL PrintO(6)
  1799.         CASE "X9O5X4"
  1800.             gameString$ = gameString$ + "O8"
  1801.             CALL PrintO(8)
  1802.         CASE "X9O5X6"
  1803.             gameString$ = gameString$ + "O3"
  1804.             CALL PrintO(3)
  1805.         CASE "X9O5X7"
  1806.             gameString$ = gameString$ + "O8"
  1807.             CALL PrintO(8)
  1808.         CASE "X9O5X8"
  1809.             gameString$ = gameString$ + "O7"
  1810.             CALL PrintO(7)
  1811.     END SELECT
  1812.     playerMove = GetLocation
  1813.     gameString$ = gameString$ + "X" + S$(playerMove)
  1814.     CALL PrintX(playerMove)
  1815.     SELECT CASE gameString$
  1816.         CASE "X9O5X1O2X3", "X9O5X1O2X4", "X9O5X1O2X6", "X9O5X1O2X7"
  1817.             gameString$ = gameString$ + "O8"
  1818.             CALL PrintO(8)
  1819.             CALL WinLine(vertM)
  1820.         CASE "X9O5X1O2X8" '''''''''''''''''''''''''
  1821.             gameString$ = gameString$ + "O7"
  1822.             CALL PrintO(7)
  1823.         CASE "X9O5X2O4X1", "X9O5X2O4X3", "X9O5X2O4X7", "X9O5X2O4X8"
  1824.             gameString$ = gameString$ + "O6"
  1825.             CALL PrintO(6)
  1826.             CALL WinLine(acrossMid)
  1827.         CASE "X9O5X2O4X6"
  1828.             gameString$ = gameString$ + "O3" '''''''''''''''''''''''''
  1829.             CALL PrintO(3)
  1830.         CASE "X9O5X3O6X1", "X9O5X3O6X2", "X9O5X3O6X7", "X9O5X3O6X8"
  1831.             gameString$ = gameString$ + "O4"
  1832.             CALL PrintO(4)
  1833.             CALL WinLine(acrossMid)
  1834.         CASE "X9O5X3O6X4" '''''''''''''''''''
  1835.             gameString$ = gameString$ + "O2"
  1836.             CALL PrintO(2)
  1837.         CASE "X9O5X4O8X1", "X9O5X4O8X3", "X9O5X4O8X6", "X9O5X4O8X7"
  1838.             gameString$ = gameString$ + "O2"
  1839.             CALL PrintO(2)
  1840.             CALL WinLine(vertM)
  1841.         CASE "X9O5X4O8X2"
  1842.             gameString$ = gameString$ + "O3"
  1843.             CALL PrintO(3)
  1844.         CASE "X9O5X6O3X1", "X9O5X6O3X2", "X9O5X6O3X4", "X9O5X6O3X8"
  1845.             gameString$ = gameString$ + "O7"
  1846.             CALL PrintO(7)
  1847.             CALL WinLine(diagBL)
  1848.         CASE "X9O5X6O3X7" ''''''''''''''''
  1849.             gameString$ = gameString$ + "O8"
  1850.             CALL PrintO(8)
  1851.         CASE "X9O5X7O8X1", "X9O5X7O8X3", "X9O5X7O8X4", "X9O5X7O8X6"
  1852.             gameString$ = gameString$ + "O2"
  1853.             CALL PrintO(2)
  1854.             CALL WinLine(vertM)
  1855.         CASE "X9O5X7O8X2"
  1856.             gameString$ = gameString$ + "O4"
  1857.             CALL PrintO(4)
  1858.         CASE "X9O5X8O7X1", "X9O5X8O7X2", "X9O5X8O7X4", "X9O5X8O7X6"
  1859.             gameString$ = gameString$ + "O3"
  1860.             CALL PrintO(3)
  1861.             CALL WinLine(diagBL)
  1862.         CASE "X9O5X8O7X3" ''''''''''''''''''
  1863.             gameString$ = gameString$ + "O6"
  1864.             CALL PrintO(6)
  1865.     END SELECT
  1866.     playerMove = GetLocation
  1867.     gameString$ = gameString$ + "X" + S$(playerMove)
  1868.     CALL PrintX(playerMove)
  1869.     SELECT CASE gameString$
  1870.         CASE "X9O5X1O2X8O7X4", "X9O5X1O2X8O7X6"
  1871.             gameString$ = gameString$ + "O3"
  1872.             CALL PrintO(3)
  1873.             CALL WinLine(diagBL)
  1874.         CASE "X9O5X1O2X8O7X3"
  1875.             gameString$ = gameString$ + "O6"
  1876.             CALL PrintO(6)
  1877.         CASE "X9O5X2O4X6O3X1", "X9O5X2O4X6O3X8"
  1878.             gameString$ = gameString$ + "O7"
  1879.             CALL PrintO(7)
  1880.             CALL WinLine(diagBL)
  1881.         CASE "X9O5X2O4X6O3X7"
  1882.             gameString$ = gameString$ + "O8"
  1883.             CALL PrintO(8)
  1884.         CASE "X9O5X3O6X4O2X1", "X9O5X3O6X4O2X7"
  1885.             gameString$ = gameString$ + "O8"
  1886.             CALL PrintO(8)
  1887.             CALL WinLine(vertM)
  1888.         CASE "X9O5X3O6X4O2X8"
  1889.             gameString$ = gameString$ + "O7"
  1890.             CALL PrintO(7)
  1891.         CASE "X9O5X4O8X2O3X1", "X9O5X4O8X2O3X6"
  1892.             gameString$ = gameString$ + "O7"
  1893.             CALL PrintO(7)
  1894.             CALL WinLine(diagBL)
  1895.         CASE "X9O5X4O8X2O3X7"
  1896.             gameString$ = gameString$ + "O1"
  1897.             CALL PrintO(1)
  1898.         CASE "X9O5X6O3X7O8X1", "X9O5X6O3X7O8X4"
  1899.             gameString$ = gameString$ + "O2"
  1900.             CALL PrintO(2)
  1901.             CALL WinLine(vertM)
  1902.         CASE "X9O5X6O3X7O8X2"
  1903.             gameString$ = gameString$ + "O1"
  1904.             CALL PrintO(1)
  1905.         CASE "X9O5X7O8X2O4X1", "X9O5X7O8X2O4X3"
  1906.             gameString$ = gameString$ + "O6"
  1907.             CALL PrintO(6)
  1908.             CALL WinLine(acrossMid)
  1909.         CASE "X9O5X7O8X2O4X6"
  1910.             gameString$ = gameString$ + "O3"
  1911.             CALL PrintO(3)
  1912.         CASE "X9O5X8O7X3O6X1", "X9O5X8O7X3O6X2"
  1913.             gameString$ = gameString$ + "O4"
  1914.             CALL PrintO(4)
  1915.             CALL WinLine(acrossMid)
  1916.         CASE "X9O5X8O7X3O6X4"
  1917.             gameString$ = gameString$ + "O1"
  1918.             CALL PrintO(1)
  1919.     END SELECT
  1920.     playerMove = GetLocation
  1921.     gameString$ = gameString$ + "X" + S$(playerMove)
  1922.     CALL PrintX(playerMove)
  1923.  
  1924. FUNCTION GetLocation
  1925.     nope:
  1926.     where$ = INPUT$(1)
  1927.     here = VAL(where$)
  1928.     IF here < 1 OR here > 9 OR INSTR(gameString$, where$) <> 0 THEN
  1929.         GOTO nope
  1930.     ELSE
  1931.         IF MID$(gameString$, LEN(gameString$) - 1, 1) = "X" THEN
  1932.             CALL PrintO(here)
  1933.         ELSE
  1934.             CALL PrintX(here)
  1935.         END IF
  1936.     END IF
  1937.     GetLocation = here
  1938.  
  1939.  
  1940. FUNCTION Center (this$)
  1941.     Center = INT((80 - LEN(this$)) / 2)
  1942.  
  1943. SUB P (onOff)
  1944.     pause$ = INPUT$(1)
  1945.     IF onOff = TRUE AND pause$ = CHR$(27) THEN END
  1946.  
  1947. FUNCTION S$ (number)
  1948.     S$ = LTRIM$(STR$(number))

Offline euklides

  • Forum Regular
  • Posts: 128
    • View Profile
Re: Tic Tac Toe
« Reply #1 on: August 19, 2021, 11:23:34 am »
Classic of classic !

If you can take the center "5" case, you have the best chances of null or perhaps to win !

But let's imagine now that the checkerboard is more than 3 squares in size ...  :)
Why not yes ?

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Tic Tac Toe
« Reply #2 on: August 19, 2021, 01:31:56 pm »
Classic of classic !

If you can take the center "5" case, you have the best chances of null or perhaps to win !

But let's imagine now that the checkerboard is more than 3 squares in size ...  :)

There is a way to win from corner start and opponent then picks the middle.

Offline Jaze

  • Newbie
  • Posts: 86
    • View Profile
Re: Tic Tac Toe
« Reply #3 on: August 19, 2021, 05:57:49 pm »
Starting with a corner gives you more ways to force a win, by occupying three corners or two adjacent corners and the center or one corner and two adjacent squares filled. Starting at the center is definitely best for defense though

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Tic Tac Toe
« Reply #4 on: August 19, 2021, 07:20:02 pm »
I had to refresh my memory of the TTT lesson I got here at this forum from a vid link.

First guy plays corner
2nd must play center for any hope.
First plays opposite (diagonal).
2nd must not play corner! or will loose. That was the lesson where my earlier AI player had failed, always thinking corner is preferred to side if no win or spoiler was available.