Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

get_board_size: (str) -> int The parameter refers to a valid game board. Given that our game boards are square, this means that the length of

get_board_size: (str) -> int The parameter refers to a valid game board. Given that our game boards are square, this means that the length of the parameter is a perfect square. This function is to return the length of each side of the given game board. NOTE: Make sure that your get_board_size function's return type is correct.
create_empty_board: (int) -> str The parameter refers to the size of a valid game board. You may assume that its value is 1 and MAX_BOARD_SIZE. This function is to return a string for storing information about a game board whose size is given by the parameter. Each character in the returned string is to have been set to the EMPTY character, to indicate that no cells have been chosen yet.
get_str_index: (int, int, int) -> int The first and second parameters refer to the row and column indices, respectively, of a cell in a valid game board whose size is given by the third parameter. You may assume that the parameters refer to valid values. This function is to return the index in the string representation of the game board corresponding to the given row and column indices.
make_move: (str, int, int, str) -> str The first parameter refers to a one character string containing a symbol (usually, but not necessarily, an 'R' or 'B'). The second and third parameters refer to row and column indices, respectively, of a cell in the valid game board referred to by the fourth parameter. This function is to return the game board that results when the given symbol is placed at the given cell position in the given game board. You may assume that the cell at the specified row and column in the game board is initially EMPTY.
get_increment: (str, int) -> int The first parameter refers to a string that describes one of the four directions: DOWN, ACROSS, DOWN_RIGHT, or DOWN_LEFT. The second parameter refers to a valid game board size. This function is to return the difference between the str indices of two adjacent cells on a line that goes in the direction specified by the first parameter. You may assume that the given direction is one of the four directions listed above.
get_last_index: (int, int, str, int) -> int The first and second parameters refer to the row and column indices, respectively, of a cell in a valid game board whose size is given by the last parameter. The third parameter refers to a string that describes one of the directions: DOWN, ACROSS, DOWN_RIGHT, or DOWN_LEFT. This function is to return the str index of the last cell in a line that begins at the specified location and goes in the specified direction all the way to the game board boundary, on a game board of the specified size. You may assume that the row or column number is valid for the game board. You may also assume that, when the direction is DOWN_LEFT, the row and column are either on the top row or the rightmost column of the game board, and when the direction is DOWN_RIGHT, the row and column are either on the top row or the leftmost column of the game board.

I need to write this program in python.

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

Marketing Database Analytics

Authors: Andrew D. Banasiewicz

1st Edition

0415657881, 978-0415657884

More Books

Students also viewed these Databases questions

Question

6. Identify characteristics of whiteness.

Answered: 1 week ago

Question

e. What are notable achievements of the group?

Answered: 1 week ago