Question: Create a Javascript program that: a.) SNAKES AND LADDER Create a player object that will represent a user playing the snakes and ladders game. The

 Create a Javascript program that: a.) SNAKES AND LADDER Create a

Create a Javascript program that: a.) SNAKES AND LADDER Create a player object that will represent a user playing the snakes and ladders game. The object will have the ff. properties & method position() - stores the current position of the player in the game board roll() - generates a random number base on a 6-sided dice move() - generates the move that player will take. The method will generate a number from 1-10; if even number, it will call the the snake(), if odd it will call the ladder() ladder() - moves the player on the game board based on the roll() value snake() - moves the player back on the game board based on the roll() value show() - shows the current position of the player. The method will also prompt a message whether the player has reached the end tile of the game Note: - create a constructor function to declare the object - every new instance of the player will have the position 1 on the game board - there are only 100 tiles in the game board - create 2 instances of the player that will play the game - have those player call the methods to simulate the game

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!