"""IB111 cv06 first task. The task learns how to use assert statement. """ def parameter_check(start_position, end_position, dimension): """Type and logic check of parameters. TASK 1 / IMPLEMENT THE FUNCTION parameter_check(). use 'assert' to check parameters pass the tests in the script assertion_tester.py checks if the given move is a valid for a chess knight board is indexed by zero indexing the function has to check all the possible incorrect inputs - non-valid move - non-integer coordinates - type mismatch - ... any problem is reported by an AssertionError :param start_position: start of the move, coordinates, tuple (x, y) :param end_position: end of the move, coordinates, tuple (x, y) :param dimension: dimension of a desk, tuple (x, y) :return: """ pass # REPLACE BY YOUR CODE def move_knight(start_position, end_position, dimension): """Move knight to the new position. DO NOT CHANGE THIS CODE, :param start_position: start of the move, coordinates, tuple (x, y) :param end_position: end of the move, coordinates, tuple (x, y) :param dimension: dimension of a desk, tuple (x, y) :return: np array """ # checks if the parameters are correctly set parameter_check(start_position, end_position, dimension) # create desk x, y = dimension board = [[0 for _ in range(y)] for _ in range(x)] # unfold coordinates x0, y0 = start_position x1, y1 = end_position # write the old and the new knight position to the desk board[x0][y0] = 1 board[x1][y1] = 2 return board