Answered step by step
Verified Expert Solution
Link Copied!

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! image text in transcribedimage text in transcribedimage text in transcribed

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 statement

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

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions

Question

3. What might you have done differently

Answered: 1 week ago

Question

4. Did you rethink your decision?

Answered: 1 week ago

Question

3. Did you seek anyones advice?

Answered: 1 week ago