Answered step by step
Verified Expert Solution
Link Copied!

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 get_factor and check_guess.
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 get_factor.
FORWARD_FACTOR =1
DOWN_FACTOR =2
BACKWARD_FACTOR =3
UP_FACTOR =4
# Constants that describe the threshold for scoring. This should be
# used in function get_points.
THRESHOLD =5
BONUS =12
# Constants that describe the two players and the result of the game. These
# should be used as return values in functions get_current_player and
# get_winner.
P1= 'player one'
P2= 'player two'
P1_WINS = 'player one wins'
P2_WINS = 'player two wins'
TIE = 'tie game'
# Constants that describe which puzzle to play. Replace the 'puzzle1.txt' with
# any other puzzle file (e.g., 'puzzle2.txt') to play a different game.
PUZZLE_FILE = 'puzzle1.txt'
# Helper functions.
# Do NOT modify these.
# You are welcome to call them in the function bodies that you write.
def get_column(puzzle: str, col_num: int)-> str:
"""Return column col_num of puzzle.
Preconditions:
-0<= col_num < 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

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

More Books

Students also viewed these Databases questions

Question

What are major aspects of intrusion prevention?

Answered: 1 week ago

Question

What is Aufbau's rule explain with example?

Answered: 1 week ago