Question: lass TestValidMoves ( unittest . TestCase ) : def testValidMoves ( self ) : Tests that valid _ moves returns correct positions

lass TestValidMoves(unittest.TestCase):
def testValidMoves(self):
"""Tests that valid_moves returns correct positions"""
self.assertCountEqual(solveable((0,0)),{(1,2),(2,1)})
self.assertCountEqual(solveable((2,2)),{(0,1),(0,3),(1,0),(1,4),(3,0),(3,4),(4,1),(4,3)})
self.assertCountEqual(solveable((7,7)),{(5,6),(6,5)})
# 'k' denotes a knight
# 'x' denotes possible moves
# Positions should be given in (row, column) tuples
# 01234567
#0--------
#1--------
#2--------
#3--------
#4--------
#5- x ------
#6-- x -----
#7 k -------
# TODO: Fill in the data to test valid_moves on the board above
k_idx =(3,3)
expected_valid_moves =???

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!