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

Cerrado Publicado hace 2 años Pagado a la entrega
Cerrado Pagado a la entrega

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.

Python

Nº del proyecto: #31838242

Sobre el proyecto

10 propuestas Proyecto remoto Activo hace 2 años

10 freelancers están ofertando un promedio de $27 por este trabajo

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 Más

$50 USD en 1 día
(28 comentarios)
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 en 1 día
(2 comentarios)
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 Más

$25 USD en 7 días
(1 comentario)
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 Más

$25 USD en 3 días
(0 comentarios)
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 Más

$25 USD en 7 días
(0 comentarios)
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 Más

$30 USD en 7 días
(3 comentarios)
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 Más

$25 USD en 7 días
(0 comentarios)
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 Más

$30 USD en 1 día
(0 comentarios)
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 Más

$25 USD en 7 días
(0 comentarios)
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 Más

$15 USD en 7 días
(0 comentarios)
0.0