Advertisement
Guest User

Untitled

a guest
Mar 19th, 2023
901
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.42 KB | None | 0 0
  1. Let's play tic-tac-toe together. You should play well and try to win. Follow all of the instructions below.
  2.  
  3. After the instructions, we can start playing. Whoever is player X will go first.
  4.  
  5. I will declare who is X and who is O.
  6.  
  7. ------------------------------------------
  8. {{{ BEGIN INSTRUCTIONS }}}
  9. ------------------------------------------
  10.  
  11. ## Board
  12.  
  13. Format for an empty board:
  14.  
  15. ```
  16. . . .
  17. . . .
  18. . . .
  19. ```
  20.  
  21. Numeric labels for each board position:
  22.  
  23. 123
  24. 456
  25. 789
  26.  
  27. ------------------------------------------
  28.  
  29. ## Game-Over-Check (GOC)
  30.  
  31. Process for checking if the game is over:
  32.  
  33. - Write out the board position numbers and values for every possible 3-in-a-row
  34. - Check each of the written combinations and see if there is a valid 3-in-a-row
  35. - Announce the game is over if there is a valid 3-in-a-row
  36.  
  37. - Rows:
  38. - Row 1 - pos 1,2,3: ValValVal
  39. - Row 2 - pos 4,5,6: ValValVal
  40. - Row 3 - pos 7,8,9: ValValVal
  41. - Columns:
  42. - Col 1 - pos 1,4,7: ValValVal
  43. - Col 2 - pos 2,5,8: ValValVal
  44. - Col 3 - pos 3,6,9: ValValVal
  45. - Diagonals:
  46. - Diag 1 - pos 1,5,9: ValValVal
  47. - Diag 1 - pos 3,5,7: ValValVal
  48.  
  49. ------------------------------------------
  50.  
  51. ## Example 1 of running GOC
  52.  
  53. Board:
  54.  
  55. ```
  56. X . O
  57. X X .
  58. O O .
  59. ```
  60.  
  61. Run GOC:
  62.  
  63. - Rows:
  64. - R1 - pos 1,2,3: X.O
  65. - R2 - pos 4,5,6: XX.
  66. - R3 - pos 7,8,9: OO.
  67. - Columns:
  68. - C1 - pos 1,4,7: XXO
  69. - C2 - pos 2,5,8: .XO
  70. - C3 - pos 3,6,9: O..
  71. - Diagonals:
  72. - D1 - pos 1,5,9: XX.
  73. - D1 - pos 3,5,7: OXO
  74.  
  75. Result: No 3-in-a-row, game is ongoing.
  76.  
  77. ------------------------------------------
  78.  
  79. ## Example 2 of running GOC
  80.  
  81. Board:
  82.  
  83. ```
  84. . . X
  85. . O .
  86. O X .
  87. ```
  88.  
  89.  
  90. Run GOC:
  91.  
  92. - Rows:
  93. - R1 - pos 1,2,3: ..X
  94. - R2 - pos 4,5,6: .O.
  95. - R3 - pos 7,8,9: OX.
  96. - Columns:
  97. - C1 - pos 1,4,7: ..O
  98. - C2 - pos 2,5,8: .OX
  99. - C3 - pos 3,6,9: X..
  100. - Diagonals:
  101. - D1 - pos 1,5,9: .O.
  102. - D1 - pos 3,5,7: XOO
  103.  
  104. Result: No 3-in-a-row, game is ongoing.
  105.  
  106. ------------------------------------------
  107.  
  108. ## Example 3 of running GOC
  109.  
  110. Board:
  111.  
  112. ```
  113. X . O
  114. X O .
  115. X . O
  116. ```
  117.  
  118. Run GOC:
  119.  
  120. - Rows:
  121. - R1 - pos 1,2,3: X.O
  122. - R2 - pos 4,5,6: XO.
  123. - R3 - pos 7,8,9: X.O
  124. - Columns:
  125. - C1 - pos 1,4,7: XXX
  126. - C2 - pos 2,5,8: .O.
  127. - C3 - pos 3,6,9: O.O
  128. - Diagonals:
  129. - D1 - pos 1,5,9: XOO
  130. - D1 - pos 3,5,7: OOX
  131.  
  132. Result: Column 1 has a 3 X's in a row! Player X wins.
  133.  
  134. ------------------------------------------
  135.  
  136. ## Example 4 of running GOC
  137.  
  138. Board:
  139.  
  140. ```
  141. X X O
  142. . O X
  143. O . X
  144. ```
  145.  
  146. Run GOC:
  147.  
  148. - Rows:
  149. - R1 - pos 1,2,3: XXO
  150. - R2 - pos 4,5,6: .OX
  151. - R3 - pos 7,8,9: O.X
  152. - Columns:
  153. - C1 - pos 1,4,7: X.O
  154. - C2 - pos 2,5,8: XO.
  155. - C3 - pos 3,6,9: OXX
  156. - Diagonals:
  157. - D1 - pos 1,5,9: XOX
  158. - D1 - pos 3,5,7: OOO
  159.  
  160. Result: Diagonal 2, top-right to bottom left, has a 3 O's in a row! Player O wins.
  161.  
  162. ------------------------------------------
  163.  
  164. ## Play Instructions
  165.  
  166. - We take turns. I'll make a move, then you make a move, then back to me. And so on.
  167.  
  168. On your turn:
  169. - After my move, before you make a move, run the GOC using the updated board
  170. - Then make your move.
  171. - Display the updated board
  172. - Run the GOC again using the updated board
  173.  
  174. ------------------------------------------
  175. {{{ END INSTRUCTIONS }}}
  176. ------------------------------------------
  177.  
  178. Let's start the game :)
  179.  
  180. I'll be player X, you will play O.
  181.  
  182. I play an X at position 5. Your turn.
  183.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement