Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please make sure the code is in Python! Thank you! To simulate the playing of this game you will need to produce code for the
Please make sure the code is in Python! Thank you!
To simulate the playing of this game you will need to produce code for the following functions: (a) make_deck(seed-12345): This function has one argument seed that may have value None or some positive integer. Its default value is 12345 The function will return a 1-dimensional NumPy array that contains a random shuffling of the integers from 1 to 54, inclusive. Each integer represents a card from the deck, according to the following ordering of the cards ace of clubs, 2 of clubs, ..., king of clubs, ace of diamonds, 2 of diamonds, ..., king of spades, joker0, jokerl. So, 1 represents the ace of clubs, 2 represents the 2 of clubs, 13 repre- sents the king of clubs, and so on. The numbers 53 and 54 represent the two jokers To shuffle the deck, you should use the NumPy random sub- module and the submodule function shuffle(). The statement import numpy.random as rand is at the top of the template and so the submodule will be available to use Using the seed value 12345, this should produce the following shuffled deck: 29, 41,40, 31,7,26, 34, 13,50, ..., 42,37,2, 30, 38, 35] The possible values for the argument seed are integers between 0 and 232 -1. In the template project.py, the statement rand.seed(seed) ap- pears just below the def statement for this function. Do not alter this statementStep 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