From 4e5d65b621bad96621c2e06fac8e97098f85b384 Mon Sep 17 00:00:00 2001 From: Aldrin Misquitta Date: Sat, 13 Mar 2021 14:52:18 +0400 Subject: [PATCH] Deleted main.class. Not sure what it is doing here --- 66 Number/java/main.class | 69 --------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 66 Number/java/main.class diff --git a/66 Number/java/main.class b/66 Number/java/main.class deleted file mode 100644 index c3df4ebf..00000000 --- a/66 Number/java/main.class +++ /dev/null @@ -1,69 +0,0 @@ - -import java.time.temporal.ValueRange; -import java.util.Arrays; -import java.util.Random; -import java.util.Scanner; - -public class Number { - - public static int points = 0; - - public static void printempty() { System.out.println(" "); } - - public static void print(String toprint) { System.out.println(toprint); } - - public static void main(String[] args) { - print("YOU HAVE 100 POINTS. BY GUESSING NUMBERS FROM 1 TO 5, YOU"); - print("CAN GAIN OR LOSE POINTS DEPENDING UPON HOW CLOSE YOU GET TO"); - print("A RANDOM NUMBER SELECTED BY THE COMPUTER."); - printempty(); - print("YOU OCCASIONALLY WILL GET A JACKPOT WHICH WILL DOUBLE(!)"); - print("YOUR POINT COUNT. YOU WIN WHEN YOU GET 500 POINTS."); - printempty(); - - try { - while (true) { - print("GUESS A NUMBER FROM 1 TO 5"); - - - Scanner numbersc = new Scanner(System.in); - String numberstring = numbersc.nextLine(); - - int number = Integer.parseInt(numberstring); - - if (!(number < 1| number > 5)) { - - Random rand = new Random(); - - int randomNum = rand.nextInt((5 - 1) + 1) + 1; - - if (randomNum == number) { - print("YOU HIT THE JACKPOT!!!"); - points = points * 2; - } else if(ValueRange.of(randomNum, randomNum + 1).isValidIntValue(number)) { - print("+5"); - points = points + 5; - } else if(ValueRange.of(randomNum - 1, randomNum + 2).isValidIntValue(number)) { - print("+1"); - points = points + 1; - } else if(ValueRange.of(randomNum - 3, randomNum + 1).isValidIntValue(number)) { - print("-1"); - points = points - 1; - } else { - print("-half"); - points = (int) (points * 0.5); - } - - print("YOU HAVE " + points + " POINTS."); - } - - if (points >= 500) { - print("!!!!YOU WIN!!!! WITH " + points + " POINTS."); - return; - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } -}