MP9
Distributed Maze
Due dates may be found on the schedule.

Change Log

2024-11-14 10:20 CDT
Updated mp9.zip to fix the test cases for maze solvability (previously this wasn’t being run).

1 Concept

In this MP, you will create a web service that works together with other students’ web services to create a collaborative distributed infinite maze.

The maze is organized around tiles or segments, 7×7 mini-mazes. Each tile has (up to) four exits, one on the center of each of its four sides. The infinite maze is generated by requesting new tiles as soon as a given tile is exited. We have an early proof of concept which doesn’t use servers, instead re-using the same tile every time, which we hope will help the idea make more sense.

Some of the points in this MP are handled by automated tests. The remaining points are handled by your code correctly interacting with others’ code in an in-class demo.

2 Technical Overview

3 Initial Files

Initial files are available in mp9.zip, including two files you’ll edit:

The Makefile has a variety of targets:

4 Specification

In mazegen.py, implement a web service with the following properties:

5 Tips

We have a separate page on maze generation.

6 Testing your code

If you run your mazegen.py and visit it in the browser, you will see a visualization of mazes and a field for registering your maze generator with a middleware.

If you run python3 -m pytest you’ll see our estimation of the correctness of your solution.

Automated tests will also be run when you submit your code on the secure upload site.

7 In-lecture deployment on November 21

On November 21 we will run all maze generators as part of an in-lecture check-off for the other half of your MP9 grade.

7.1 Pre-lecture testing

  1. In a terminal, run make view Two ports will be displayed: 34009 and 5000

  2. Open both ports in your browser.

  3. In the Middleware service URL field of the 5000 port page, enter the 34009 port URL.

    You should see Connected displayed below the middleware URL entry field.

  4. On the 34009 port page, use the arrow keys (or WASD if you prefer that form of directionality) to navigate the maze.

    You should start in an empty tile; the next tile should be your /static tile; after that you should see a series of /dynamic/F tiles.

  5. (optional) With a friend, run all of your apps at once on the VM. Enter one of your 34009 URLs in all of your 5000 pages. All visit the same 34009 page; you should see a maze made of a random selection of all of your solutions.

7.2 In-lecture testing

  1. On November 21, before class starts,

    1. Start your VM
    2. Make sure you have your latest code on your VM
    3. In your VM’s terminal, from the mp9 directory, run make background
    4. Log out of your VM (e.g. by shutting VS Code)
    5. Ensure that your code’s webpage (http://fa24-cs340-###.cs.illinois.edu:5000) still works
  2. On November 21, during class,

    1. We will share a middleware URL for you to all enter into your pages
    2. You will collectively explore that maze
    3. We will share another middleware URL that uses your code in a different way
    4. Throughout, we will log what each server does and use that to populate the in-class half of your MP9 grade.