0% found this document useful (0 votes)
3 views3 pages

Assignment

This assignment involves creating a maze navigation program using a Node class to represent rooms and their connections in a graph structure. Users will navigate from room A to room L by inputting directional commands, with specific output requirements and error handling. The project emphasizes clean code, proper class design, and requires a screenshot of the working program upon completion.

Uploaded by

Omar Dabaa
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Assignment

This assignment involves creating a maze navigation program using a Node class to represent rooms and their connections in a graph structure. Users will navigate from room A to room L by inputting directional commands, with specific output requirements and error handling. The project emphasizes clean code, proper class design, and requires a screenshot of the working program upon completion.

Uploaded by

Omar Dabaa
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Assignment

Maze Navigation Using Graph Nodes


Overview:

In this assignment, you will implement a maze navigation program using references
between instances of a Node class to represent rooms and their connections. The
structure is a simple graph where each node connects to up to four other nodes (north,
south, east, west).

Each room (node) will be represented by an object with references to its neighboring
rooms. You will simulate a user walking from room A (start) to room L (finish), navigating the
maze based on allowed directions.

Specifications

1. Create a Node class with the following:

o A name (e.g., "A", "B", ...)

o Four directional references: north, south, east, and west to other Node
objects

o A method to return available directions from the current node

2. Set up the maze as shown in the diagram by linking nodes correctly.

3. Start the user in room A. Display:

o The current room name

pg. 1
o The text: "You are in room <RoomName> of a maze of twisty
little passages, all alike."

o The directions the user can move

4. Prompt the user to input a move: n, s, e, w. Move the user accordingly if possible. If
not, display an error.

5. Repeat until the user reaches room L (Finish). Then display a congratulatory
message.

6. No GUI is required. Use console interaction.

Expected Output Sample (User Journey A → B → F → G → H → L)


You are in room A of a maze of twisty little passages, all alike.

You can go east or south.

> e

You are in room B of a maze of twisty little passages, all alike.

You can go west or south.

> s

You are in room F of a maze of twisty little passages, all alike.

You can go north or east.

> e

You are in room G of a maze of twisty little passages, all alike.

You can go west or east.

> e

You are in room H of a maze of twisty little passages, all alike.

You can go west or south.

> s

You are in room L of a maze of twisty little passages, all alike.

Congratulations! You have reached the finish.

Rules

pg. 2
• You must use object references for node connections.

• Use clean, readable code with appropriate class design.

• You do not need to present this to a TA.

• You must submit at least one screenshot of your working program showing a
sample navigation reaching room L.

• Late submissions are not accepted.

Rubric

Criteria Points

Maze modeled correctly using Node class 25

Correct navigation logic & input parsing 25

Console prompts and responses are clear 15

Accurate connection of rooms 10

Clean code & class structure 10

Screenshot of working code (room L) 10

Error handling for invalid directions 5

Total 100

pg. 3

You might also like