Difference between revisions of "Python - Maze Generation Assignment"
From WLCS
(→MazeRoom class) |
|||
Line 14: | Line 14: | ||
=== Attributes === | === Attributes === | ||
* MazeRoom should have the following attributes with default values: | * MazeRoom should have the following attributes with default values: | ||
− | ** roomToNorth | + | ** roomToNorth - references the a doorway to the north. A None value means that there is wall |
− | ** roomToSouth | + | *** Default: None |
− | ** roomToEast | + | ** roomToSouth - references the a doorway to the south. A None value means that there is wall |
− | ** roomToWest | + | *** Default: None |
− | ** row | + | ** roomToEast - references the a doorway to the east. A None value means that there is wall |
− | ** col | + | *** Default: None |
− | ** visited | + | ** roomToWest - references the a doorway to the west. A None value means that there is wall |
+ | *** Default: None | ||
+ | ** row - the row number for the Room | ||
+ | *** Default: -1 | ||
+ | ** col - the column number for the Room | ||
+ | *** Default: -1 | ||
+ | ** visited - a Boolean that keeps track of whether or not the room has been visited in the maze algorithm | ||
+ | *** Default: False | ||
=== Methods === | === Methods === | ||
* MazeRoom should have the following method: | * MazeRoom should have the following method: |
Revision as of 12:41, 16 May 2013
Contents
Objective
- You will create a maze generation program
- You will use create Python classes that represent a MazeRoom and a Maze
Resources
MazeRoom class
- Create a file named MazeRoom.py for the MazeRoom class
Attributes
- MazeRoom should have the following attributes with default values:
- roomToNorth - references the a doorway to the north. A None value means that there is wall
- Default: None
- roomToSouth - references the a doorway to the south. A None value means that there is wall
- Default: None
- roomToEast - references the a doorway to the east. A None value means that there is wall
- Default: None
- roomToWest - references the a doorway to the west. A None value means that there is wall
- Default: None
- row - the row number for the Room
- Default: -1
- col - the column number for the Room
- Default: -1
- visited - a Boolean that keeps track of whether or not the room has been visited in the maze algorithm
- Default: False
- roomToNorth - references the a doorway to the north. A None value means that there is wall
Methods
- MazeRoom should have the following method:
- def __init__(self, row = -1, col = -1) - set the internal row and col attributes to be the same as the input parameters
Maze class
- Create a file named Maze.py for the Maze class