Answered step by step
Verified Expert Solution
Question
1 Approved Answer
# Probably should put a few functions hereabouts def inputCard ( file _ name: str ) - > tuple: with open ( file _ name,
# Probably should put a few functions hereabouts
def inputCardfilename: str tuple:
with openfilename, r as a:
lines areadlines
b linesstrip
verifiers boolintnumber for number in line.stripsplit for line in lines:
return b verifiers
def getVerifierInputinput: str list:
character inputlowersplit
indices ordchars orda for chars in character
return sortedindices
def guessToIndexguess: int tuple:
with openverifierAddressinr as a:
lines areadlines
for line in lines:
guessvalue, x y line.stripsplit
if intguessvalue guess:
return intx inty
return None
def checkVerifiergameCard: tuple, guess: int bool:
verifiers gameCard
x y guessToIndexguess
return verifiersxy
def listCriteriagameCards: list str:
criteria "You have criteria
formatlengameCards
for index, gameCard in enumerategameCards:
criterion gameCard
criteria
formatchr index criterion
return criteriastrip
def showTurnHistoryguesses: list, history: list str:
headers xyz A B C D E
rows
for guess, res in zipguesses history:
row :dformatguess
for r in res:
if r :
row
elif r :
row X
elif r :
row O
rows.appendrowrstrip
return headers
joinrows
def showVerifierverifier: list str:
output
for row in verifier:
output joinO if cell else X for cell in row
return output.strip
if namemain:
# This is not part of the tests, so you can use this
# to help check your code is working.
pass I am having too issues "Returned O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O
O O O O O O O O O O O O and expected O O O X X O O O O O X O
O O O O O X X X O O X O
O X O O O X O O O O X O
O X O X O X O X X O X O
O X X X O O X O X X O O
O O X O O O O O X O O O
O O O X O X O X X O O X
X O O X O X O X O O X X
O O O O X X X O O O X O
O O X X O O O O O X O O
O O X X X O O X X O O O
O O O O O O O O O O O O "The turn history output doesn't match! Pay careful attention to the spaces
We expected:
xyz A B C D E
X X O
X X O
X X O
But was:
xyz A B C D E
X X O
X X O
X X O
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