Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please make sure code is absolutely correct and follows what is asked, also if can be put in copy paste format would be really helpful

Please make sure code is absolutely correct and follows what is asked, also if can be put in copy paste format would be really helpful thanks!!
image text in transcribed
image text in transcribed
output of what code should show attached below
image text in transcribed
# 2222222222222222222222222222222222222222222222222 # Returns the score from a memory game # The strategy is to remove the number that has # been in the memory the longest time . - 3 marks A memory game is played (and scored) as follows: Random numbers between 0 and 10 (zero inclusive) are called out one at a time. In this memory game the player can remember a maximum of s5 previously called out numbers. If the called number is already in the player's memory, a point is added to the player's score. If the called number is not in the player s memory, called number to his memory, first removing another number if his simulation of this game, the number which is removed from the player's memory is the number that has been in the player's memory the longest time. For example, if the random numbers are [3, 4, 3, 0,7, 4, 5, 2, 1, 3, the game proceeds as follows the player adds the memory is full. In our Called number 3 Score: 0, Numbers in memory: 131 Called nmber 4: Score: 0,Numbers in memory: 3, 41 Called number 3: Score: 1, Numbers in memory: 3, Called number 0 Score: 1, Numbers in memory: 3, 4, 01 Called number 7: Score: , Numbers in memory: 3. 4, 0, 7] Called number 4 Score: 2, Numbers in memory: 3, 4, 0, 71 Called number 5: Score: 2, Numbers in memory: 3, 4, 0, 7, 5] Called number 2: Score: 2, Numbers in memory 14. 0, 7, 5, 21 Called number 1: Score: 2, Numbers in memory: [0, 7, 5, 2, 11 Called number 3: Score: 2, Numbers in memory: 7, Complete the get memory score) function which is passed a list of random numbers as a returns the final score using the algorithm described above. For example, the following code: parameter and

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

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions