reset password
Author Message
rabbott
Posts: 1649
Posted 22:43 Sep 05, 2019 |

The Project 1 description suggests running a program as follows.

In a command-prompt window enter (for example):

> python pacman.py -l mediumMaze -p SearchAgent -a fn=bfs

You can run the same program by replacing the line 
args = readCommand( sys.argv[1:] )  # Get game components based on input

in pacman.py with the line

args = readCommand(['-l', 'mediumMaze', '-p', 'SearchAgent', '-a', 'fn=bfs'])

In other words, convert the command-line arguments into a list of strings. Then run the file pacman.py directly, e.g., from your IDE.