Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Project7RylanSorensen {
- import java.util.Random;
- import java.util.Scanner;
- public static void main(String[] args) {
- int tokens = 20;
- int i = 0;
- Scanner keyboard = new Scanner(System.in);
- String response = "yes";
- while (response.equalsIgnoreCase("yes")) {
- for (i=0; i<2; i++) {
- tokens += calculateWin();
- // while response = "yes"
- // tokens += methodcall
- System.out.println("You have " + tokens + " tokens");
- System.out.println("You now have " + tokens + " tokens");
- System.out.println("Would you like to play again? Yes/No");
- response = keyboard.nextLine();
- }
- }
- public static int calculateWin(int[] scores) {
- System.out.println("You earned " + scores + " points");
- System.out.println("Your spin was " + scores[0] + " " + scores[1] + " " + scores[2]);
- if (scores[0] == 7 && scores[1] == 7 && scores[2] == 7) {
- return 750;
- } else if ((scores[0] == 7 && scores[1] == 7) || (scores[0] == 7 && scores[2] == 7)
- || (scores[1] == 7 && scores[2] == 7)) {
- return 20;
- } else if (scores[0] == scores[1] && scores[1] == scores[2]) {
- return 75;
- } else if (scores[0] == scores[1] || scores[1] == scores[2] || scores[0] == scores[2]) {
- return 5;
- } else {
- return -1;
- }
- }
- public static int[] generateRandomDigits(int low, int high, int size) {
- int[] values = new int[2];
- int i = 0;
- int[] numbers = new int[count] ;
- for (i = count - 1; i <= 0; i--);
- }
- public static int findRandom(int low, int high) {
- return (int) (Math.random() * (high-low+1)+1);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement