Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Let's play tic-tac-toe together. You should play well and try to win. Follow all of the instructions below.
- After the instructions, we can start playing. Whoever is player X will go first.
- I will declare who is X and who is O.
- ------------------------------------------
- {{{ BEGIN INSTRUCTIONS }}}
- ------------------------------------------
- ## Board
- Format for an empty board:
- ```
- . . .
- . . .
- . . .
- ```
- Numeric labels for each board position:
- 123
- 456
- 789
- ------------------------------------------
- ## Game-Over-Check (GOC)
- Process for checking if the game is over:
- - Write out the board position numbers and values for every possible 3-in-a-row
- - Check each of the written combinations and see if there is a valid 3-in-a-row
- - Announce the game is over if there is a valid 3-in-a-row
- - Rows:
- - Row 1 - pos 1,2,3: ValValVal
- - Row 2 - pos 4,5,6: ValValVal
- - Row 3 - pos 7,8,9: ValValVal
- - Columns:
- - Col 1 - pos 1,4,7: ValValVal
- - Col 2 - pos 2,5,8: ValValVal
- - Col 3 - pos 3,6,9: ValValVal
- - Diagonals:
- - Diag 1 - pos 1,5,9: ValValVal
- - Diag 1 - pos 3,5,7: ValValVal
- ------------------------------------------
- ## Example 1 of running GOC
- Board:
- ```
- X . O
- X X .
- O O .
- ```
- Run GOC:
- - Rows:
- - R1 - pos 1,2,3: X.O
- - R2 - pos 4,5,6: XX.
- - R3 - pos 7,8,9: OO.
- - Columns:
- - C1 - pos 1,4,7: XXO
- - C2 - pos 2,5,8: .XO
- - C3 - pos 3,6,9: O..
- - Diagonals:
- - D1 - pos 1,5,9: XX.
- - D1 - pos 3,5,7: OXO
- Result: No 3-in-a-row, game is ongoing.
- ------------------------------------------
- ## Example 2 of running GOC
- Board:
- ```
- . . X
- . O .
- O X .
- ```
- Run GOC:
- - Rows:
- - R1 - pos 1,2,3: ..X
- - R2 - pos 4,5,6: .O.
- - R3 - pos 7,8,9: OX.
- - Columns:
- - C1 - pos 1,4,7: ..O
- - C2 - pos 2,5,8: .OX
- - C3 - pos 3,6,9: X..
- - Diagonals:
- - D1 - pos 1,5,9: .O.
- - D1 - pos 3,5,7: XOO
- Result: No 3-in-a-row, game is ongoing.
- ------------------------------------------
- ## Example 3 of running GOC
- Board:
- ```
- X . O
- X O .
- X . O
- ```
- Run GOC:
- - Rows:
- - R1 - pos 1,2,3: X.O
- - R2 - pos 4,5,6: XO.
- - R3 - pos 7,8,9: X.O
- - Columns:
- - C1 - pos 1,4,7: XXX
- - C2 - pos 2,5,8: .O.
- - C3 - pos 3,6,9: O.O
- - Diagonals:
- - D1 - pos 1,5,9: XOO
- - D1 - pos 3,5,7: OOX
- Result: Column 1 has a 3 X's in a row! Player X wins.
- ------------------------------------------
- ## Example 4 of running GOC
- Board:
- ```
- X X O
- . O X
- O . X
- ```
- Run GOC:
- - Rows:
- - R1 - pos 1,2,3: XXO
- - R2 - pos 4,5,6: .OX
- - R3 - pos 7,8,9: O.X
- - Columns:
- - C1 - pos 1,4,7: X.O
- - C2 - pos 2,5,8: XO.
- - C3 - pos 3,6,9: OXX
- - Diagonals:
- - D1 - pos 1,5,9: XOX
- - D1 - pos 3,5,7: OOO
- Result: Diagonal 2, top-right to bottom left, has a 3 O's in a row! Player O wins.
- ------------------------------------------
- ## Play Instructions
- - We take turns. I'll make a move, then you make a move, then back to me. And so on.
- On your turn:
- - After my move, before you make a move, run the GOC using the updated board
- - Then make your move.
- - Display the updated board
- - Run the GOC again using the updated board
- ------------------------------------------
- {{{ END INSTRUCTIONS }}}
- ------------------------------------------
- Let's start the game :)
- I'll be player X, you will play O.
- I play an X at position 5. Your turn.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement