Essential Question: How can I use random in Java to create a pig dice game?
Mastery Objectives:
SWBAT create a random generator.
SWBAT create a nested conditional statement.
SWBAT use aliases to compare strings.
Resources: https://www.playonlinedicegames.com/pig
Rules for pig dice:
The goal of the game is to be the first person to reach 100 points. To make this game faster, you can change the winning number of points threshold, for example 50 or 20.
The first person rolls the dice multiple times until they decide to pass their turn. By passing their turn, they bank the total number of points that they rolled. But if they roll a 1, they lose all the points for that turn and it is the next person's turn.
Example:
Player 1:
roll 1 - 6
roll 2 - 3
roll 3 - 5
total roll - 14
total points for player 1 - 14
Player 1 passes their turn to Player 2
Player 2:
roll 1 - 5
roll 2 - 4
roll 3 - 6
roll 4 - 1
total roll - 0
total points - 0
Player 2 loses their turn and it goes to player 1
Directions: Recreate the pig dice game so that you are playing against the computer. Create a random number to decide how many times the computer rolls the dice. Decide a threshold number in order to win. Use lower numbers to test your project.
Requirements:
Pseudocode for the project
Code for the project