Question: playGame This method would normally be really complex, but with all our helper methods it will be pretty easy. I Make a loop that continues
playGame
This method would normally be really complex, but with all our helper methods it will be pretty easy.
I
Make a loop that continues until makeMove returns true, indicating that the game is over.
Inside the loop, call the prompt function, get input from the player, and pass the input to the makeMove method. Use the playerInput Scanner to get input from the player. DO NOT create a new Scanner.
Finally, after the loop, output "You Won!" if playerAtGoal is true or "Goodbye!" if it is not true.
You can do this very cleanly with a dowhile loop with just one statement in the do block. However, this is not required.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
