Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package tom;
- import java.util.Random;
- public class bet {
- private String playerName;
- private int betAmount;
- private int roll;
- private Random random = new Random();
- // This is how the dice randomisation is coded
- public bet(String playerName, int betAmount)
- {
- this.playerName = playerName;
- this.betAmount = betAmount;
- this.roll = roll;
- }
- public int rollDice() {
- int dice1 = random.nextInt(6);
- int dice2 = random.nextInt(6);
- roll = dice1+dice2;
- return roll;
- // This will randomly roll dice 1 and 2 and return the answer
- }
- public int getBetAmount()
- {
- return betAmount;
- // This will get the amount of money left and return it
- }
- }
- // This is the end of the class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement