Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

NIM The program is to be written in Matlab. Program must be liberally commented. The program is a game played by a human versus the

NIM

The program is to be written in Matlab. Program must be liberally commented.

The program is a game played by a human versus the machine.

At the start, the prompt asks the human to enter three non-zero integers. These will constitute how many counters are in each Pile.

The machine then asks who goes first.

A turn consists of selecting a Pile and taking a number of counters from that pile.

For example, if the Piles contain 3, 7 and 12 counters, a legal move consists of taking from 1 to 3 from Pile 1, or 1, 2, 7 from Pile2 etc.

The object of the game is to be the player to take the last counter(s). So if Piles contain 0 2 0, the player whose turn it is will take 2 from Pile 2 and win.

The program must play and optimal strategy so if it has a winning position it will win the game. If it does not have a winning position it should try to extend the game.

At the end of the game, the program must declare the winner.

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

Intelligent Information And Database Systems 6th Asian Conference Aciids 2014 Bangkok Thailand April 7 9 2014 Proceedings Part I 9 2014 Proceedings Part 1 Lnai 8397

Authors: Ngoc-Thanh Nguyen ,Boonwat Attachoo ,Bogdan Trawinski ,Kulwadee Somboonviwat

2014th Edition

3319054759, 978-3319054759

More Books

Students also viewed these Databases questions

Question

State the uses of job description.

Answered: 1 week ago

Question

Explain in detail the different methods of performance appraisal .

Answered: 1 week ago

Question

2. What are your challenges in the creative process?

Answered: 1 week ago