Suljettu

Write an algorithm and a program that plays the game of NIM

Write a detailed algorithm and a program that plays the ancient Chinese game of NIM. Actually, this is a simplified version of the original game. In this game, the person who runs your program will be one of the two human players, the program should act as the other player, as well as provide the narrative for the game and keep score, invite a friend to be the third player. Your program must keep score impartially while participating in the game.

The program must perform the following:

• Introduce and describe the game, the computer shall introduce itself as the AI player, and prompt the human players for his or her names along with MIT Ids.

• Program is to be interactive to receive and display the response.

• To display a greeting to the human player that incorporates the name provided in response to the prompt: Welcome <user’s name> to the game of Taking Stones.

• The user’s name must be output in proper name case (i.e., mixed case starting with upper case for the first letter) regardless of the case the user types in.

• The users shall input the number of stones to be picked either by using a standard random number generator function or may input according to their own strategy but the number should be less than or equal to three (3) and more than zero.

• The program must reject and display a valid message if the number of stones to be removed are either less than one (1) or more than three (3) and remind them of the game constraints. In case of invalid entries program to prompt that player to re-enter an appropriate number.

• The program should have the computer use the optimal playing strategy. The optimal strategy is as follows: Divide the remaining number of stones by three. If the remainder is zero, then two stones are removed, or else one stone is removed. For example, if the remaining number of stones is nine or fifteen, then two stones are removed; if the remaining number of stones is eight or ten, then one stone is removed.

• Both the human players shall have their own strategies to play.

• When one of the players has won a game, the program must output a congratulatory message naming the winner along with ID.

• The program should allow the users to play additional games of NIM as long as he/she enters a “y” or “yes” (lowercase or uppercase) in response to a “Do you want to play again?” prompt.

Taidot: Python

Näytä lisää: program word game, write simple text based game code, write game nim code servlet, write java program implements simple game, complete java program plays simple card game, write java program roulette game, write program blackjack game, write program play game blackjack, write java program quiz game, write java program game, algorithm for chess game program, write a program to implement binary search algorithm in java, how to write algorithm for matlab program, write a program to simulate snake and ladder game between 2 players., write a program that simulates the game of battleship, how to write algorithm for java program, write a program for minimum spanning trees using kruskal’s algorithm in java, write a program that plays a simple dice game between the computer and the user, write a program of snake game in c

Tietoa työnantajasta:
( 0 arvostelua ) Melbourne, Australia

Projektin tunnus: #31838242

10 freelanceria on tarjonnut keskimäärin $27 tähän työhön

urmate

javaHi I have checked your project description. I have excellent programming and development skills. Contact me with all the details and requirements for your project for further discussion. I will provide you with de Lisää

$50 USD 1 päivässä
(28 arvostelua)
4.6
jamesdobbs11

Hi! I am expert in Python, Matlab, ML, C++, C, C# and have 12 years experience. I work according to your requirement to provide the best quality and customer satisfaction. Thank you!

$20 USD 1 päivässä
(2 arvostelua)
1.7
vrusungu

PHD IN SOFTWARE DEVELOPMENT AND ARCHITECTURE. EXPERT IN ABOVE NAMED SKILLS. HELLO DEAR CLIENT! Thank you for sharing your project details, I have read and understood them. Am interested in your project and I would lik Lisää

$25 USD 7 päivässä
(1 arvostelu)
2.7
AndreiSokolov

===== C/C++/Java/Python ===== Dear Client! I am Andrei, experienced programmer from Russia. I have read your requirement and I noticed that I am appropriate to this project. As a skillful software developer, I have ric Lisää

$25 USD 3 päivässä
(0 arvostelua)
0.0
deemueni001

MASTERS IN SOFTWARE DEVELOPMENT AND ARCHITECTURE. EXPERT IN ABOVE NAMED SKILLS Hi there! Thank you for sharing your project requirement, I have carefully read the project description and I would like to take part in t Lisää

$25 USD 7 päivässä
(0 arvostelua)
0.0
omer19

hello, I have seen that you need an experienced python expert for algorithm and a program that plays the game of NIM . I am a professional python expert with more than 10 years experience. I have carefully understo Lisää

$30 USD 7 päivässä
(3 arvostelua)
0.0
davidoliver574

MASTERS IN SOFTWARE DEVELOPMENT AND ARCHITECTURE. EXPERT IN JAVASCRIPT, HTML5, CSS C, C++, PYTHON, JAVA AND PHP, BOT MAKING AND SCRIPTING, AUTOMATION. Hi there! Thank you for sharing your project requirement, I have ca Lisää

$25 USD 7 päivässä
(0 arvostelua)
0.0
CodingHelpLine

Hello Sir/Madam I have development experience in various Programming Languages, OOP, Data Structures, Database Driven applications, APIs, Files handling and Data Transformation, ETL and various frameworks. I assure y Lisää

$30 USD 1 päivässä
(0 arvostelua)
0.0
VIShALALPE20

Im Hardworkin aspirant and i assure you do this work as my first priority. Hi, I've read your description carefully. I have full experience with Python I've also worked on several similar projects. So I can complete yo Lisää

$25 USD 7 päivässä
(0 arvostelua)
0.0
sreeparno2000

Hi there ! I am an expert in Python,programming and have 5 years of experience. I also have few Python projects like this project. I work according to your requirement to provide the best quality and customer satisfact Lisää

$15 USD 7 päivässä
(0 arvostelua)
0.0