Nim is a mathematical game of strategy in which two players


Project - Game of Nim

Nim is a mathematical game of strategy in which two players take turns removing objects from distinct heaps. On each turn, a player must remove at least one object, and may remove any number of objects provided they all come from the same heap. The goal of the game is to avoid being the player who must remove the last object.

Nim is typically played as a misère game, in which the player who takes the last object loses. Nim can also be played as a normal play game, where the player taking the last object wins. This is called normal play because the last move is a winning move in most games; Nim is usually played so that the last move loses.

How to play the game

The game of Nim is two player game (you and computer)
Players take turns
On each turn, a player must choose one pile and remove at least one object from the chosen pile.
Two ways to play
Normal play, the player who removes the last object is the winner
Misère play, the player who picks the last object wins.

Normal Play

Convert the size of each pile into its binary notation
Add the columns up independently modulo 2.
The resulting value is called the Nim sum

Project Requirements

The game starts with 4 piles
Pile 1 contains 7 objects
Pile 2 contains 5 objects
Pile 3 contains 3 objects
Pile 4 contains 1 object

The user plays a misère game

The user should be given the option to choose who should make the first move (human player or the computer)

If the user is given the option to play either a misère game or a normal game

If the user is given the option to choose the number of piles and the number of objects in each pile.

Attachment:- Project.rar

Solution Preview :

Prepared by a verified Expert
Assembly Language: Nim is a mathematical game of strategy in which two players
Reference No:- TGS02515407

Now Priced at $90 (50% Discount)

Recommended (95%)

Rated (4.7/5)