How create a loop which gives the player instructions on


Your task is to recreate this game in Java, albeit in a simpler, text-based format. The player enters sequences of three numbers to see if they follow the hidden rule.

When the player has entered their sequence, the program should reply whether or not the sequence followed the rule.

You can use the same rule or create your own. Regardless, the game is played the same way.

How Create a loop which gives the player instructions on what to input. Then read input from the player. The input will be either one of two options:

• If the user enters the word "answer" or some other string you choose to indicate the player is ready to end the game and guess. - In this case, prompt the user to guess our game's rule, then output the answer. - Advanced We can use the .contains() method to analyze the guess and our output accordingly:

* If the guess contains the string "doubled" or "doubling" or "multiple," the guess if most likely wrong.

* If the guess contains the string "increase" or "increasing," the guess is most likely right and you can tailor the output accordingly.

• Three numbers separated by spaces. - If the user enters a sequence that follows the rules, output "Yes!" - Otherwise output "No."he

This is the way my instructor looking for

Thanks

String num;

do{ Scanner secan = new Scanner(System.in);

System.out.println("Please enter sequence number str: "); // it can be "123"

num = secan.nextLine(); // then read it

int reh=Integer.parseInt(num); // then convert it into integer

System.out.println(reh);

for(String retval: num.split("")){ // then split that

System.out.println(retval);

// ono loop and one method go insdie here which is calculate the number increasing order then print

}while(num.contains("answer"));

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: How create a loop which gives the player instructions on
Reference No:- TGS02944871

Expected delivery within 24 Hours