def pokemon_map():
    """Interpret a square map with user location and available spots.

    >>> pokemon_map()
    🐱  🌲  🌲  🌲  🌲  🌲  🌲  🌲
    🌲  🌲  🌲  🌲  🌲  🌲  🌲  🌲
    🌲  🌲  🌲  🌲  🌲  🌲  🌲  🌲
    🌲  🌲  🌲  🌲  🌲  🌲  🌲  🌲
    🌲  🌲  🌲  🌲  🌲  🌲  🌲  🌲
    🌲  🌲  🌲  🌲  🌲  🌲  🌲  🌲
    🌲  🌲  🌲  🌲  🌲  🌲  🌲  🌲
    🌲  🌲  🌲  🌲  🌲  🌲  🌲  🌲
    """
    map_positions = [["🌲" for i in range(8)] for x in range(8)]

    pokemon_row = get_row()
    pokemon_column = get_column()
    map_positions[pokemon_column][pokemon_row] = "🐱"

    for row in map_positions:
        print("  ".join(row))
 def test_get_column_output(self):
     """Assert users most updated column position."""
     self.assertEqual(get_column(), 2)
 def test_get_column_type(self):
     """Assert that user column position is an int."""
     self.assertEqual(type(get_column()), int)
示例#4
0
 def test_move_character_column_boundary(self, mock_user_input):
     """Assert that character column position cannot move out of bounds and user must select different direction"""
     pokemon['Position'][1] = 0
     expected_output = 1
     move_character()
     self.assertEqual(get_column(), expected_output)
示例#5
0
 def test_move_character_north(self, mock_user_input):
     """Assert that character column position is subtracted by one."""
     move_character()
     self.assertEqual(get_column(), 1)
 def test_change_column_add_large(self):
     """Assert that users current column position is added by 2."""
     change_column(2)
     self.assertEqual(get_column(), 7)
 def test_change_column_subtract(self):
     """Assert that users current column position is subtracted by 1."""
     change_column(-1)
     self.assertEqual(get_column(), 4)
 def test_change_column_add(self):
     """Assert that users current column position is added by 1."""
     change_column(1)
     self.assertEqual(get_column(), 6)