Question
Dr. Nim : We re going to create a Dr. Nim spinoff game. In this game, you have a random number of marbles (between 12
Dr. Nim: Were going to create a Dr. Nim spinoff game. In this game, you have a random number of marbles (between 12 and 31). Play occurs in rounds between 2 players: the human user and the computer. In each round, the player can select 1-3 marbles to remove. The player who gets the last marble wins the game.
Our game will have two players Player 1 (you) and the computer. Player 1 will select between 1-3 marbles to remove. The computer will randomly select between 1-3 marbles to remove during its turn.
Example: Assuming my game randomly started with 15 marbles on the board:
O O O O O O O O O O O O O O O
How many marbles do you want? Pick between 1-3: 4
Invalid selection. Try again.
How many marbles do you want? Pick between 1-3: 3
The function should deduct the computers randomly selected number of marbles from the current number of marbles on the board. The function should also output how many marbles the computer chose to remove from the board.
In python 3.7
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