Question: THE CODE SHOULD BE COMPLETED IN PYTHON!! I am stuck on these following functions as they are giving me errors: This is how the game
THE CODE SHOULD BE COMPLETED IN PYTHON!!
I am stuck on these following functions as they are giving me errors:


This is how the game looks like:

These are my errors currently:


Can anyone please help me complete these functions!!
8. Function: slide_right(str, int, str) -> str Specification: This function takes three parameters. The first parameter is the square being added to the game board. The second parameter is a row number and the third parameter is the string representation of a game board. Assume that the square, row number, and game board are valid. This function returns a string that is like the original game board, except that: o the square from the first parameter has been slid into the "beginning" (i.e., first column) of the given row number; o the square at the "end" (i.e., last column) has slid off the game board; o the remaining squares have slid to the right. 9. Function: slide_left(str, int, str) -> str Specification: This function takes three parameters. The first parameter is the square being added to the game board. The second parameter is a row and the third parameter is the string representation of a game board. Assume that the square, row number, and game board are valid. This function returns a string that is like the original game board, except that: o the square from the first parameter has been slid into the "end" (i.e., last column) of the given row number; o the square at the "beginning" (i.e., first column) has slid off the game board; o the remaining squares have slid to the left. fataan Player 1 is using square R and Player 2 is using square Y. The first player to match 3 squares wins! The Game Board: 3 4 5 -|-|- 1 2 1 2 - 1 1 -- | I |-|-|- Player l's turn. Which move, slide right or slide left, would you like to do? Enter 1 for slide right and 2 for slide left: FAIL: test_slide_left (__main__. SanityTest) Check the type contract of function slide_left. Traceback (most recent call last): File "/Users/Ruthba/Desktop/CS A1/al_checker.py", line 130, in test_slide_left self._check('slide_left', [sf. SQUARE_RED, 1, EMPTY_TEST_BOARD], str) File "/Users/Ruthba/Desktop/CS A1/al_checker.py", line 152, in _check self.assert TrueCresult, message) AssertionError: False is not true : slide_left should return a str, but instead it returned None. FAIL: test_slide_right (__main__. SanityTest) "Check the type contract of function slide_right. Traceback (most recent call last): File "/Users/Ruthba/Desktop/CS A1/a1_checker.py", line 126, in test_slide_righ t self._check('slide_right', [sf. SQUARE_RED, 1, EMPTY_TEST_BOARD], str) File "/Users/Ruthba/Desktop/CS A1/a1_checker.py", line 152, in _check self.assert TrueCresult, message) AssertionError: False is not true : slide_right should return a str, but instead it returned None. INFO: Checking the function slide_left... --R F INFO: Checking the function slide_right... R--- F
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
