1 Concentration Game 100 points Fr this assigamient you will implement a modited
ID: 3600910 • Letter: 1
Question
1 Concentration Game 100 points Fr this assigamient you will implement a modited version of anentration Gane. Clark Concentration Game here: https://en.wikipedia.org/wiki/Concentration. (gae) the Wikpedia page on the Note that in this assignment (both bere and in the eode) I used wods "deck and-hoard isteechangeably, for basically the same thing Before reading the description below, watch the video! inade on how your game should plage https://youtu.be/yuusaAry I also peowide you with a file A3-exaple-runs.txt that coutains the example runs thone I typedwbe mking the video) Watching the videp will make following the below description mach easier. Note that the video does not have a sound as it is nDeeded. All the requirements implied by the video aad e ample runs m A3-example-ras.txt aDd the provided code in a3 xxxxx py and the reqairements stated in this assignment should be cosidesed mandatory reqairements for the assigument You may assume that the player will folow your instructions and ester the cect date type bat mot mecssarily the corect data values for that type. For eample, if you ask the player for an even integer betwees 2 and 52 yos may ssume that indeed they will enter an integer (rather than a real Bumber say), but your prograan should test if the player estesed an integer in the mquired raw, and it i inded evet»der Your program slaould prompt the parr toprprat tbr e try until eurrert isput s obtained. You shoald also fuly test your program-for example, what does your peogram do if the player does something illy, lake etteres a location that is alteady discovered, or euters two sane locationsWatch the video to ane how your progra sbould belhave in thesea Also, think of the desig of your program. For example, yoar program should hamction that displays the current board (I peowided that fully), but it shoulkd also have a functios that displays the boand with two wositions revealed only provided a brade and doctrings So that function). Tse functicns should be called fro your gme playing function aled play gane) Designing your peogram by decomposing it isto smalee subpeoims (to be impionnted as fanctions makes peogramming easer, less prone to enoes and alkes your eode smore readable. You will be graded on these aspects od urpeogtam too The ganar usually played with cards brd dawn a table. Your game will not grap ellen s display the board, but instead i will peint the board with the tools that we have seen in class so far, Le. piting on Python cosole. A typical eard has a suitand atauk on otse side·Let's call that side of a dazd, a forside.nd tbe other ca e a dull side, bead of suit and a rank each of our eards wil have a single dharactes on its face side and that charactee wil be ana upper ease letter od english alphabet or any special character (e.g those you can find on the upper sow of yor keyboard). A typical card deck has the same drawing on the dull side of the oards. Instead of a drawug our cards will have a character star. *- their dull side. From now on we al, assulnewestart off with such a deck with some number ofcwd·For the drk to be suitable for plaig Concentration game, each character that appears the derk Deeds to appear on aa eves-her of cwds Furthermore. the deck cannot have cards with on their face sides, as we coald uot distinguish a face side from an a dall side of such cards Therfore be ore playing we eed to clean up the deck. In particular, we need to remove all the cards that have a on their faces. In addition, for each character that appears on an odd umber of cards, re meed to remove exactly one card with that character from the deck. After such a clean-up, the resalting deck can be used for playing Concestration game. We call such a derk, the one where each character ay pears on evea number of cards and where no card has * its Nde, a playable Finally we call a deck nigorous if it is playable and each character of the deck apprars eactly two tis Your game mast use a (one dimensional) list as the board as implied by the provided code in a3.xoxp The game starts off bby asling the plver (1) if they waated a (rigoroas) dk and thas board, autonatically gmrrated (2) or if they wat to stazt with the deck given in a file E option (1) s chosen, you aeed to first peosugt the playes for the sine of the dck You sould oaly acorpt eve ltteges betwern 2 and 52 for Option 1. As part of this assiggment I provided you with a fally codd fumcticn calied create beard, that returns a rigorous deck of the given size. Thus option 1 ouly plays a gane with rigrous decks Koption (2) s chosetL the deck will be tead from a le·The planet will eata abu e od that tle wbra peumpted. Ipewsde you with a couple of peactice files (TAs will test your assigumeut with these and some othee les) To we them, you eed to put those 6les in the same directory folder as your progam a3,xxx.Py. As part of this assgest I peovsided you with a fully ded functiou, ealed read-rau-board, that reads tbe fik and returns a list ouataug the deck of cards specifed in the fie. This deck however is not necessarily playable Thas you fiest seed to make it playable. For that you will code a function caled clean,up.board. I provide a header and docstrings for that function. That fuction sold return a playable deck and that is the deck you will play the game with in Option 2. But before playing the gme wih it for the fun of it, you would lke to know if the resulting deck is not only playable but also rigoOS For that you will seed to complete the function called is,rigorous for which I provide you with the brader and dootrings Finally you will notice that a3xox.py has a function caled playgane Cboard. That is whse you should pat you gane paying code. The function play gaze tals a playable deck as inut parameter (ie a deck created by option 1 or option ) Once the player completes the game, yo should also print the mber of ganses it took to sove it and how Ear it r the optimal (alt hoagh impossable without luck) en bosrd)/2 gaesses yrt.ad whtner ebr Outside of those functions, in, in the ain you will do initial coenmuniatiG with t p in the a3,xxxxx specifiedExplanation / Answer
your Image was not visible completely Kindly provide us better quality image so that your question can be answered
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.