Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This program must be done in the 'ready to program' java ide without scanner class, please do not submit a program done in another ide,

This program must be done in the 'ready to program' java ide without scanner class, please do not submit a program done in another ide, because my professor uses 'ready to program' and it doesn't support newer methods like scanner.

Ready to program ide: https://ready-to-program-with-java.software.informer.com/1.7/

DO NOT SUBMIT AN ANSWER WHICH DOES NOT FOLLOW THESE INSTRUCTIONS, I HAVE ALREADY WASTED 3 TUTOR QUESTIONS TRYING TO SOLVE THIS PROGRAM, GETTING ANSWERS FROM PEOPLE NOT READING THE QUESTION.

YOU CAN ASK ME IF YOU HAVE ANY QUESTIONS, JUST DO NOT SUBMIT A CLEARLY WRONG PROGRAM.

Nim is a two-player game in which players take turns picking up sticks. The game begins with various numbers of sticks in a number of piles. On any turn, a player must choose a pile and remove one or more sticks from that pile (up to the number of sticks in the pile). The object of the game is to force your opponent to pick up the last stick in the last pile.

Write a program that allows two people to play a game of Nim. The program should start by creating four piles of sticks, each with a number of sticks that varies randomly from four to eight and displaying the piles on the screen.

The program should then prompt the first player to remove a number of sticks from a pile. Once that player has provided valid input, the program should then adjust the piles and display the new configuration. This process should continue until one player has won the game, at which time the computer should print a congratulatory note to the winner.

At the end of each game, the computer should start a new game if the users state that they want to do so. Once the users state that they are done, the computer should print the number of games won by each player.

The sample output is

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions