Question
NIM in c++ NIM is a simple game that can be played with matchsticks. Two players,in turn, remove a number of matchsticks from the board.
NIM in c++ NIM is a simple game that can be played with matchsticks. Two players,in turn, remove a number of matchsticks from the board. The player who left with the last matchstick losses the game. In the board of NIM,the matchsticks are arranged in multiple rows having 2n+1 matchsticks in each row. An example of the board in a 4-line configuration is given below. I III IIIII IIIIIII The rules of the game are as follows The game is played in turns, The player can remove matchsticks from only single row in their turn. They can remove any numbers of matchstick from the selected row.How-ever,they cannot remove matchsticks from multiple rows in one turn. The player who removes the last matchstick losses the game. Mathematically, it is possible to make an unbeatable computer as long as the opponent starts the game. QUESTION Write a C++application for NIM game. 1. (25 point) Prepare the functionality for showing the current status of the board. 2.(25 point) Prepare the functionality for playing the game, i.e. getting inputs from the user to remove matchsticks until the game ends. 3. (25 point) Prepare the functionality for making the computer unbeatable. 4. (25 point) Prepare an user interactive interface (in console) for the game, e.g. start game,play in two players, play against computer etc. 2
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started