Answered step by step
Verified Expert Solution
Question
1 Approved Answer
it is computer beasd system language Programming assignment for ENSC 3213 NIM The program is to be written in Matlab. Program must be liberally commented.
it is computer beasd system language
Programming assignment for ENSC 3213 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. Programming assignment for ENSC 3213 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 winnerStep 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