Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- import java.util.Scanner;
- public class IvosGame69 {
- public static void main(String[] args) {
- Scanner s= new Scanner(System.in);
- Random r= new Random();
- System.out.println("Guess the number");
- int scanInput=s.nextInt();
- int randomNum=r.nextInt(100);
- if (scanInput>randomNum) {
- System.out.println("Go lower");
- }else {
- System.out.println("Go higher");
- }
- int scanInput2=s.nextInt();
- if (scanInput2>randomNum) {
- System.out.println("Go lower");
- }else {
- System.out.println("Go higher");
- }
- int scanInput3=s.nextInt();
- if (scanInput3>randomNum) {
- System.out.println("Go lower");
- }else {
- System.out.println("Go higher");
- }
- int scanInput4=s.nextInt();
- if (scanInput4>randomNum) {
- System.out.println("Go lower");
- }else {
- System.out.println("Go higher");
- }
- int scanInput5=s.nextInt();
- if (scanInput5>randomNum) {
- System.out.println("Go lower");
- }else {
- System.out.println("Go higher");
- }
- int scanInput6=s.nextInt();
- if (scanInput6>randomNum) {
- System.out.println("Go lower");
- }else {
- System.out.println("Go higher");
- }
- int scanInput7=s.nextInt();
- if (scanInput7>randomNum) {
- System.out.println("Go lower");
- }else {
- System.out.println("Go higher");
- }
- int scanInput8=s.nextInt();
- if (scanInput8>randomNum) {
- System.out.println("Go lower");
- }else {
- System.out.println("Go higher");
- }
- int scanInput9=s.nextInt();
- if (scanInput9>randomNum) {
- System.out.println("Go lower");
- }else {
- System.out.println("Go higher");
- }
- int scanInput10=s.nextInt();
- if (scanInput10>randomNum) {
- System.out.println("Go lower");
- }else {
- System.out.println("Go higher");
- }
- int scanInput11=s.nextInt();
- if (scanInput11>randomNum) {
- System.out.println("Go lower");
- }else {
- System.out.println("Go higher");
- }
- int scanInput12=s.nextInt();
- if (scanInput12>randomNum) {
- System.out.println("Go lower");
- }else {
- System.out.println("Go higher");
- if (scanInput==randomNum || scanInput2==randomNum || scanInput3==randomNum || scanInput4==randomNum
- || scanInput5==randomNum || scanInput6==randomNum || scanInput7==randomNum || scanInput8==randomNum || scanInput9==randomNum
- || scanInput10==randomNum || scanInput11==randomNum || scanInput12==randomNum)
- System.out.println("Ivo is a proper champ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement