Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This file starts with the setting up of some constant variables and some # helper functions that are provided to students, and ends with a
This file starts with the setting up of some constant variables and some
# helper functions that are provided to students, and ends with a part of
# the first function that students are to
# Some of the programming techniques used in the provided helper functions
# have not been taught yet. Students may read the docstrings to determine what
# these functi
# Constants that describe the valid directions. These should be used
# in functions getfactor and checkguess.
UP up
DOWN 'down'
FORWARD 'forward'
BACKWARD 'backward'
# Constants that describe the multiplicative factor used when scoring a
# word in a particular direction. This should be used in function getfactor.
FORWARDFACTOR
DOWNFACTOR
BACKWARDFACTOR
UPFACTOR
# Constants that describe the threshold for scoring. This should be
# used in function getpoints.
THRESHOLD
BONUS
# Constants that describe the two players and the result of the game. These
# should be used as return values in functions getcurrentplayer and
# getwinner.
P 'player one'
P 'player two'
PWINS 'player one wins'
PWINS 'player two wins'
TIE 'tie game'
# Constants that describe which puzzle to play. Replace the 'puzzletxt with
# any other puzzle file eg 'puzzletxt to play a different game.
PUZZLEFILE 'puzzletxt
# Helper functions.
# Do NOT modify these.
# You are welcome to call them in the function bodies that you write.
def getcolumnpuzzle: str colnum: int str:
Return column colnum of puzzle.
Preconditions:
colnum number of columns in puzzle
puzzle is in the proper 'Where's that word? puzzle format
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