Advertisement
Guest User

Untitled

a guest
Oct 11th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. public class Project7RylanSorensen {
  2.  
  3. import java.util.Random;
  4. import java.util.Scanner;
  5.  
  6. public static void main(String[] args) {
  7.  
  8. int tokens = 20;
  9. int i = 0;
  10. Scanner keyboard = new Scanner(System.in);
  11.  
  12. String response = "yes";
  13. while (response.equalsIgnoreCase("yes")) {
  14.  
  15. for (i=0; i<2; i++) {
  16.  
  17. tokens += calculateWin();
  18.  
  19. // while response = "yes"
  20.  
  21. // tokens += methodcall
  22.  
  23. System.out.println("You have " + tokens + " tokens");
  24.  
  25. System.out.println("You now have " + tokens + " tokens");
  26.  
  27. System.out.println("Would you like to play again? Yes/No");
  28.  
  29. response = keyboard.nextLine();
  30. }
  31. }
  32.  
  33. public static int calculateWin(int[] scores) {
  34.  
  35. System.out.println("You earned " + scores + " points");
  36.  
  37. System.out.println("Your spin was " + scores[0] + " " + scores[1] + " " + scores[2]);
  38.  
  39. if (scores[0] == 7 && scores[1] == 7 && scores[2] == 7) {
  40. return 750;
  41. } else if ((scores[0] == 7 && scores[1] == 7) || (scores[0] == 7 && scores[2] == 7)
  42. || (scores[1] == 7 && scores[2] == 7)) {
  43. return 20;
  44. } else if (scores[0] == scores[1] && scores[1] == scores[2]) {
  45. return 75;
  46. } else if (scores[0] == scores[1] || scores[1] == scores[2] || scores[0] == scores[2]) {
  47. return 5;
  48. } else {
  49. return -1;
  50. }
  51. }
  52.  
  53. public static int[] generateRandomDigits(int low, int high, int size) {
  54. int[] values = new int[2];
  55. int i = 0;
  56. int[] numbers = new int[count] ;
  57. for (i = count - 1; i <= 0; i--);
  58.  
  59. }
  60.  
  61.  
  62. public static int findRandom(int low, int high) {
  63. return (int) (Math.random() * (high-low+1)+1);
  64.  
  65.  
  66.  
  67. }
  68.  
  69. }
  70.  
  71. }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement