Advertisement
Guest User

Untitled

a guest
Sep 20th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. import java.util.Random;
  2. import java.util.Scanner;
  3.  
  4. public class IvosGame69 {
  5.  
  6. public static void main(String[] args) {
  7.  
  8. Scanner s= new Scanner(System.in);
  9. Random r= new Random();
  10. System.out.println("Guess the number");
  11. int scanInput=s.nextInt();
  12. int randomNum=r.nextInt(100);
  13. if (scanInput>randomNum) {
  14. System.out.println("Go lower");
  15. }else {
  16. System.out.println("Go higher");
  17. }
  18. int scanInput2=s.nextInt();
  19. if (scanInput2>randomNum) {
  20. System.out.println("Go lower");
  21. }else {
  22. System.out.println("Go higher");
  23. }
  24. int scanInput3=s.nextInt();
  25. if (scanInput3>randomNum) {
  26. System.out.println("Go lower");
  27. }else {
  28. System.out.println("Go higher");
  29. }
  30. int scanInput4=s.nextInt();
  31. if (scanInput4>randomNum) {
  32. System.out.println("Go lower");
  33. }else {
  34. System.out.println("Go higher");
  35. }
  36. int scanInput5=s.nextInt();
  37. if (scanInput5>randomNum) {
  38. System.out.println("Go lower");
  39. }else {
  40. System.out.println("Go higher");
  41. }
  42. int scanInput6=s.nextInt();
  43. if (scanInput6>randomNum) {
  44. System.out.println("Go lower");
  45. }else {
  46. System.out.println("Go higher");
  47. }
  48. int scanInput7=s.nextInt();
  49. if (scanInput7>randomNum) {
  50. System.out.println("Go lower");
  51. }else {
  52. System.out.println("Go higher");
  53. }
  54. int scanInput8=s.nextInt();
  55. if (scanInput8>randomNum) {
  56. System.out.println("Go lower");
  57. }else {
  58. System.out.println("Go higher");
  59. }
  60. int scanInput9=s.nextInt();
  61. if (scanInput9>randomNum) {
  62. System.out.println("Go lower");
  63. }else {
  64. System.out.println("Go higher");
  65. }
  66. int scanInput10=s.nextInt();
  67. if (scanInput10>randomNum) {
  68. System.out.println("Go lower");
  69. }else {
  70. System.out.println("Go higher");
  71. }
  72. int scanInput11=s.nextInt();
  73. if (scanInput11>randomNum) {
  74. System.out.println("Go lower");
  75. }else {
  76. System.out.println("Go higher");
  77. }
  78. int scanInput12=s.nextInt();
  79. if (scanInput12>randomNum) {
  80. System.out.println("Go lower");
  81. }else {
  82. System.out.println("Go higher");
  83.  
  84.  
  85.  
  86.  
  87. if (scanInput==randomNum || scanInput2==randomNum || scanInput3==randomNum || scanInput4==randomNum
  88. || scanInput5==randomNum || scanInput6==randomNum || scanInput7==randomNum || scanInput8==randomNum || scanInput9==randomNum
  89. || scanInput10==randomNum || scanInput11==randomNum || scanInput12==randomNum)
  90.  
  91.  
  92. System.out.println("Ivo is a proper champ");
  93.  
  94.  
  95. }
  96. }
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement