Skip to content

Instantly share code, notes, and snippets.

@NicoleCarpenter
Last active January 24, 2023 15:22
Show Gist options
  • Save NicoleCarpenter/2d0c2f8b5a0232ac483f95cd10eef118 to your computer and use it in GitHub Desktop.
Save NicoleCarpenter/2d0c2f8b5a0232ac483f95cd10eef118 to your computer and use it in GitHub Desktop.
Tic-Tac-Toe user stories
#### Playing a Single Player Game Against a Random Computer (No Configuration)
* Given I start the game
* And I am prompted with a move
* When I select a move
* Then it will place my marker (X) on the board
* Given I have made a move
* When my turn is over
* Then the computer will have a random move placed on the board with its marker (O)
* Given a player makes a move
* And the move results in three consecutive spaces
* Then the game is over
* Given a player makes a move
* And the move is the last empty spot on the board
* Then the game is over
#### Playing a Two Player Game (No Configuration)
* Given I start the game
* And I am prompted with a move
* When I select a move
* Then it will place my marker (X) on the board
* Given I have made a move
* When the second player is prompted for a move
* Then she will select a move
* And her marker (O) will be placed on the board
* Given a player makes a move
* And the move results in three consecutive spaces
* Then the game is over
* Given a player makes a move
* And the move is the last empty spot on the board
* Then the game is over
#### Selecting an Order in a Two Person Game, Regardless of Player Type
* Given I start the game
* When I am a player
* Then I will be assigned a random order (coin toss)
* Given I am a player
* When my order is 1
* Then I will make the first move (X)
* Given I am a player
* When my order is 2
* Then I will make the second move (O)
* Given a move has been made
* When there is a win or tie
* Then the game will be over
#### Selecting Markers, Regardless of Player Type
* Given I start the game
* When I am prompted to select my marker (X or O)
* Then I will select and be assigned my marker
* Given I have selected a marker
* When my selection has been assigned
* Then the second option will be assigned to the other player
* Given it is a player's turn
* When they make a move
* Then her specified marker will be placed on the board
* Given a move has been made
* When there is a win or tie
* Then the game will be over
#### Selecting Game Mode to Determine Players
* Given I start the game
* When the game starts
* Then I will be prompted to select a player mode (player vs player, player vs computer)
* Given I select player vs player
* When I am the first player
* Then I will be prompted to input my name
* Given I select player vs computer
* When I am the player
* Then I will be prompted to input my name
* Given the first player has input her name
* When I am the second player (not a computer)
* Then I will be prompted to input my name
* Given all names have been entered
* When gameplay begins
* Then players will exchange moves until a win or a tie condition is met
#### Playing with an Unbeatable Computer
* Given it is the computer's turn
* When the center space is available
* Then the computer will place its marker on the center space
* Given it is the computer's turn
* And the center space is not available
* When there is not an opportunity for either player to win
* Then the computer will place its marker on a corner space
* Given it is the computer's turn
* When the computer can win
* Then it will place its marker on the winning position
* Given it is the computer's turn
* When the player has a next-move win
* Then the computer will place its piece to block the player's win
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment