Snakes and Ladder Game : Java source code

Tutorials Shared by the Internet Community


  Top Tutorials     New Tutorials     Submit     Login     Register  

Snakes and Ladder Game : Java source code

This program will simulate a regular snakes and ladders game, where you will be facing the computer. You and the computer start at square 1, and the
  • Total Hits: 23911

  • Average Rating :
    URL RatingURL RatingURL RatingURL RatingURL Rating


  • Total Votes: 203 votes

  • Category: JAVA/Core JAVA

  • Submitted on: 2013-12-13 08:51:42

  • Submitted By: Java Hungry

  • Set as Favorite


Print rules of the game
Makes the board for the player
Prompt user to start the game
If (input==’y’)
Then startGame
Leave command prompt

If startGame

Set starting position for user and computer to 1

User throws the dice then computer throws the dice one after other

Prints the final position after each dice throw for the user as well as computer repeatedly

If user reaches the ladder or snake bitten then reflect the final position after such propositions both
for user and computer

Whoever first reaches the 100 , will win the game , with n predefined attempts

If no one wins with in predefined attempts then prompt user to play the game again or not

Repeat step 1    More detail...

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 35.47%  72
 Two starsTwo star  Vote LeftVote MiddleVote Right 9.85%  20
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 11.82%  24
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 9.36%  19
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 33.5%  68

Caste Your Vote

 Rating  Selection  Guidelines
 Poor:     Very disappointing, useless.
 Fair:     Below average, disappointing but not useless.
 Good:     About average in its class.
 Very Good:     Above average for its category.
 Excellent:     One of the best Tutorials in its category.