Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Mission: Write a program IN C (not c# or anything else, only in C language)!!! that allows TWO HUMAN PLAYERS to play Nim against each

Mission:

Write a program IN C (not c# or anything else, only in C language)!!! that allows TWO HUMAN PLAYERS to play Nim against each other. must be TWO HUMAN PLAYERS not computer and human Instructions:

Create a project called NimGame.c.

Be sure to document your code (add comments on top of your C file). In the comments add your name, date, course, homework number, and statement of problem.

Once you are done, upload NimGame.c through Canvas. Objective and points break down for each project:

As described below.

All actions should be implemented through functions.

It is up to you to decide those function prototypes and bodies. Project: NimGame

Nim is a strategy game between two players.

Start by placing counters (coins or toothpicks or something) into 3 piles.

Those 3 counters could have a value between 5 and 10.

It is up to you to choose those 3 values. Mine shown in demo below are 3, 4, 5.

Player #1 picks a pile, then removes one or more counters from that pile. (It's okay to take the whole pile.)

Player #2 picks a pile, then removes one or more counters from that pile.

Player #1 plays again. (It's okay to choose a different pile this time.)

Whichever player is forced to take the last counter is the loser.

Write a program that allows two human players to play Nim against each other.

The program should detect when the last counter has been taken and declare a winner.

Requirements:

Prevent the users from doing anything bad:

Cannot try to remove from empty pile

Cannot try to remove more then the pile has

Cannot try to remove a negative number from pile or 0

Make the program detect when there is only one counter left and declare the winner

Visually display the counters in rows instead of just showing a number, you must use loops for this. Ex:

A: ***

B: ****

C: *****

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

Step: 3

blur-text-image

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

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions

Question

What is efficiency?

Answered: 1 week ago

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago