Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

22. OOAD with Snake and Ladder > 22.3 - Analysis of Snake and Ladder Game

22.3 ANALYSIS OF SNAKE AND LADDER GAME

After studying the elements of OOAD, let us start analysis of the snake and ladder problem. Let us prepare in detail specifications of the problem.

22.3.1 Problem specification

Description of the game:

  1. Players play alternately (turn by turn).
  2. A player throws a dice.
  3. His pebble is moved on the board depending on the dice value.
  4. If the pebble is at the bottom of the ladder, move it to the top of the ladder.
  5. If the pebble is at the mouth of the snake, move it to the tail of the snake.
  6. If any player reaches Home (H100) he wins. Play ends.
  7. If pebble tries to move ahead of Home, it reverses its direction. For example, from H98 two moves take pebble to home, but three moves take it to H99.

A project starts with the problem analysis. A complex problem is required to be thoroughly analysed before any design or coding starts. It is expected that “requirements gathering” is done before hand.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint