From 6e26c375cadc2ac0989f52a57454fdb03ce896cb Mon Sep 17 00:00:00 2001 From: ProgramDragon64 Date: Mon, 24 Nov 2025 17:16:33 -0800 Subject: [PATCH 1/3] Create PrACTICE ATTEMPT.py --- mazeBot/PrACTICE ATTEMPT.py | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 mazeBot/PrACTICE ATTEMPT.py diff --git a/mazeBot/PrACTICE ATTEMPT.py b/mazeBot/PrACTICE ATTEMPT.py new file mode 100644 index 0000000..3cbcbbe --- /dev/null +++ b/mazeBot/PrACTICE ATTEMPT.py @@ -0,0 +1,47 @@ +import sys +from pathlib import Path +from src.maze import Maze +from src.mazeRobot import MazeRobot + + +def main(): + base_dir = Path(__file__).parent + maze_file = base_dir / "mazes/maze1.json" + #maze_file = base_dir / "mazes/maze2.json" + if len(sys.argv) > 1: + arg_path = Path(sys.argv[1]) + maze_file = arg_path if arg_path.is_absolute() else (base_dir / arg_path) + + maze = Maze(str(maze_file)) + robot = MazeRobot() + robot.set_maze(maze) + + print(f"Loaded maze {maze_file} (size {maze.width}x{maze.height})") + print(f"Start: {maze.start}, End: {maze.end}") + print(f"Robot at {robot.get_position()}") + print("Enter moves: up/down/left/right, or 'q' to quit.") + print(maze.render_ascii(robot.get_position())) + #Me + # Manual mode + while True: + try: + cmd = input("> ").strip().lower() + except EOFError: + break + if cmd in ("q", "quit", "exit"): + break + if cmd == "pos": + print(robot.get_position()) + continue + ok, msg = robot.move(cmd) + print(msg) + if ok: + print(f"Position: {robot.get_position()}") + print(maze.render_ascii(robot.get_position())) + if maze.is_at_end(robot.get_position()): + break + + +if __name__ == "__main__": + main() + From 58698929c782b1bca2dcc663878d5bd1606587b1 Mon Sep 17 00:00:00 2001 From: ProgramDragon64 Date: Mon, 24 Nov 2025 17:18:37 -0800 Subject: [PATCH 2/3] I did it This commit is my attempt at the test --- mazeBot/PrACTICE ATTEMPT.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mazeBot/PrACTICE ATTEMPT.py b/mazeBot/PrACTICE ATTEMPT.py index 3cbcbbe..c2ef67f 100644 --- a/mazeBot/PrACTICE ATTEMPT.py +++ b/mazeBot/PrACTICE ATTEMPT.py @@ -22,6 +22,7 @@ def main(): print("Enter moves: up/down/left/right, or 'q' to quit.") print(maze.render_ascii(robot.get_position())) #Me + #mE2 # Manual mode while True: try: From a76eb948db11521e38e79d0d956fb1a193d129a5 Mon Sep 17 00:00:00 2001 From: ProgramDragon64 Date: Mon, 24 Nov 2025 17:22:44 -0800 Subject: [PATCH 3/3] Did a test From Raiden, Thing not working --- mazeBot/PrACTICE ATTEMPT.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mazeBot/PrACTICE ATTEMPT.py b/mazeBot/PrACTICE ATTEMPT.py index c2ef67f..08de391 100644 --- a/mazeBot/PrACTICE ATTEMPT.py +++ b/mazeBot/PrACTICE ATTEMPT.py @@ -23,6 +23,7 @@ def main(): print(maze.render_ascii(robot.get_position())) #Me #mE2 + # Test # Manual mode while True: try: