Requirement specifications

In this chapter, we will create a two-player Tic-Tac-Toe game with the following basic requirements:

  1. As a player, I should be able to register with my name and display a picture
  2. As a player, I should be able to find an opponent, that is, the second player to play against
  3. The first two players to find opponents should be paired as opponents in the game
  4. The decision as to which player gets the chance to make the first move should be fair
  5. As a player, I should be able to use my display picture as my mark, rather than the conventional X and O
  6. The decision as to who wins should be made fairly
  7. In future, we want multiple players playing online simultaneously

Now that we have the requirement specifications in place, let's see the activity flow of the game and come up with a flowchart. The following is a rough flowchart of the game workflow:

  1. Start: This is the start of the flow. The player browses the game site URL. It is being conceptualized as a site, since in future we want to allow multiple players to play simultaneously online (requirement Step 7).
  2. Register with name and display picture: The player registers himself/herself with a name and display picture (requirement Step 1).
  3. Is Opponent available?: The player finds an opponent to play against. If an opponent is found, the game can start with a toss; otherwise, the player needs to wait for the opponent (requirement Steps 2 and 3).
  4. Wait for opponent: There may be a scenario where the player is alone and registered with no one to play against, so the player needs to wait until another player registers and looks for an opponent (requirement Steps 2 and 3).
  5. Won toss?: Once the players are paired as opponents, the game starts and one of the players gets the opportunity to make the first move. To keep this fair, we will have a toss. The player may either win the toss or lose the toss (requirement Step 4).
  6. Make a move/Wait for opponent to make a move: The player winning the toss gets the first move, while their opponent would waits for the first player to make their move.
  7. Do we have a winner?: After every move, we check whether the win/draw criteria have been met and check whether we have a winner. If not, then the game continues with each player moving alternately until the game ends (requirement Step 6).
  8. Game Over: Finally, the players will either run out of moves or a player will win the game.

As we can see, the game will be played only in Steps 6 and 7 of the flowchart. The other steps are required only for setting up the game. Also, notice that this flow covers all our requirements.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset