def test_case_seven(): boundry_x = 0 boundry_y = 0 initial_loc_x = 0 initial_loc_y = 0 initial_loc_direction = "E" commands = "LLLL" expected_results = "0 0 E" actual_results = rover.run(boundry_x, boundry_y, initial_loc_x, initial_loc_y, initial_loc_direction, commands) assert actual_results == expected_results
def test_case_three(): boundry_x = 8 boundry_y = 2 initial_loc_x = 0 initial_loc_y = 2 initial_loc_direction = "N" commands = "MMMM" expected_results = "0 2 N" actual_results = rover.run(boundry_x, boundry_y, initial_loc_x, initial_loc_y, initial_loc_direction, commands) assert actual_results == expected_results
def test_case_five(): boundry_x = 0 boundry_y = 0 initial_loc_x = 0 initial_loc_y = 0 initial_loc_direction = "E" commands = "MMLMM" expected_results = "0 0 N" actual_results = rover.run(boundry_x, boundry_y, initial_loc_x, initial_loc_y, initial_loc_direction, commands) assert actual_results == expected_results
def test_case_one(): boundry_x = 8 boundry_y = 8 initial_loc_x = 1 initial_loc_y = 2 initial_loc_direction = "E" commands = "MMLMRMMRRMML" expected_results = "3 3 S" actual_results = rover.run(boundry_x, boundry_y, initial_loc_x, initial_loc_y, initial_loc_direction, commands) assert actual_results == expected_results
import rover import json import sys if __name__ == "__main__": if len(sys.argv) <= 1: rover.run() else: with open(sys.argv[1], "r") as f: config_dict = json.loads(f.read()) rover.run(**config_dict)