Guest User

Untitled

a guest
Mar 19th, 2023
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.56 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
  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. - R1 - pos 1,2,3: Val Val Val
  39. - R2 - pos 4,5,6: Val Val Val
  40. - R3 - pos 7,8,9: Val Val Val
  41. - Columns:
  42. - C1 - pos 1,4,7: Val Val Val
  43. - C2 - pos 2,5,8: Val Val Val
  44. - C3 - pos 3,6,9: Val Val Val
  45. - Diagonals:
  46. - D1 - pos 1,5,9: Val Val Val
  47. - D2 - pos 3,5,7: Val Val Val
  48.  
  49. ------------------------------------------
  50.  
  51. ## Example 1 of running Game-Over-Check
  52.  
  53. Board:
  54.  
  55. ```
  56. X . O
  57. X X .
  58. O O .
  59. ```
  60.  
  61. Run Game-Over-Check
  62.  
  63. - Rows:
  64. - R1 - pos 1,2,3: X . O
  65. - R2 - pos 4,5,6: X X .
  66. - R3 - pos 7,8,9: O O .
  67. - Columns:
  68. - C1 - pos 1,4,7: X X O
  69. - C2 - pos 2,5,8: . X O
  70. - C3 - pos 3,6,9: O . .
  71. - Diagonals:
  72. - D1 - pos 1,5,9: X X .
  73. - D2 - pos 3,5,7: O X O
  74.  
  75. Result: No 3-in-a-row, game is ongoing.
  76.  
  77. ------------------------------------------
  78.  
  79. ## Example 2 of running Game-Over-Check
  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: O X .
  96. - Columns:
  97. - C1 - pos 1,4,7: . . O
  98. - C2 - pos 2,5,8: . O X
  99. - C3 - pos 3,6,9: X . .
  100. - Diagonals:
  101. - D1 - pos 1,5,9: . O .
  102. - D2 - pos 3,5,7: X O O
  103.  
  104. Result: No 3-in-a-row, game is ongoing.
  105.  
  106. ------------------------------------------
  107.  
  108. ## Example 3 of running Game-Over-Check
  109.  
  110. Board:
  111.  
  112. ```
  113. X . O
  114. X O .
  115. X . O
  116. ```
  117.  
  118. Run Game-Over-Check:
  119.  
  120. - Rows:
  121. - R1 - pos 1,2,3: X . O
  122. - R2 - pos 4,5,6: X O .
  123. - R3 - pos 7,8,9: X . O
  124. - Columns:
  125. - C1 - pos 1,4,7: X X X
  126. - C2 - pos 2,5,8: . O .
  127. - C3 - pos 3,6,9: O . O
  128. - Diagonals:
  129. - D1 - pos 1,5,9: X O O
  130. - D2 - pos 3,5,7: O O X
  131.  
  132. Result: Column 1 has a 3 X's in a row! Player X wins.
  133.  
  134. ------------------------------------------
  135.  
  136. ## Example 4 of running Game-Over-Check
  137.  
  138. Board:
  139.  
  140. ```
  141. X X O
  142. . O X
  143. O . X
  144. ```
  145.  
  146. Run Game-Over-Check:
  147.  
  148. - Rows:
  149. - R1 - pos 1,2,3: X X O
  150. - R2 - pos 4,5,6: . O X
  151. - R3 - pos 7,8,9: O . X
  152. - Columns:
  153. - C1 - pos 1,4,7: X . O
  154. - C2 - pos 2,5,8: X O .
  155. - C3 - pos 3,6,9: O X X
  156. - Diagonals:
  157. - D1 - pos 1,5,9: X O X
  158. - D2 - pos 3,5,7: O O O
  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 Game-Over-Check using the updated board
  170. - Then make your move.
  171. - Display the updated board
  172. - Run Game-Over-Check 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.
Add Comment
Please, Sign In to add comment