Question: Python Your goal is to complete the following: In this assignment's programming component, you will determine the winners of two variations of the game NIM.

Python

Python Your goal is to complete the following: In this assignment's programming

component, you will determine the winners of two variations of the game

NIM. Specifically, we will be playing n-Pile, a version of NIM where

Your goal is to complete the following:

stones are removed from n piles. See the background materials above for

reference The two variations of n-Pile we will be examining are: 1.

Classic n-Pile : there are n piles and a player may remove

any number of stones from any pile during their turn; Restricted n-Pile:

In this assignment's programming component, you will determine the winners of two variations of the game NIM. Specifically, we will be playing n-Pile, a version of NIM where stones are removed from n piles. See the background materials above for reference The two variations of n-Pile we will be examining are: 1. Classic n-Pile : there are n piles and a player may remove any number of stones from any pile during their turn; Restricted n-Pile: a player may only remove a pre-specified num- ber of stones during their turn. You may have seen this represented as m1, m2,., mn)-NIM (and this can also be played on n piles) 4.1 Game Data Structures Your solutions must adhere to the following definitions for the data structures that you will use: 1. a board is a list of natural numbers where the number at index i represents the number of stones in pile. For example, if board = [0, 4, 3, 7] then board [O] would return 0 and show that pile zero is empty. Likewise board [1] would show that pile one has four stones in it. len (board) would show that there are four total piles: 2. moves is a tuple of natural numbers that represent legal amounts of stones that a player may take per turn. For example if moves was equal to (1, 3, 4), then each player may only take one stone, three stones, or four stones out of any pile. (Note that this is only applicable for restrictedPileWinner)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!