Difference between revisions of "Python - Maze Generation Assignment"
From WLCS
Line 11: | Line 11: | ||
== Directions == | == Directions == | ||
+ | * Create two files for two classes named '''MazeRoom''' and '''Maze''' | ||
+ | |||
=== MazeRoom class === | === MazeRoom class === | ||
+ | ==== Attributes ==== | ||
+ | * Your MazeRoom should have the following attributes with default values: | ||
+ | ** roomToNorth = None | ||
+ | ** roomToSouth = None | ||
+ | ** roomToEast = None | ||
+ | ** roomToWest = None | ||
+ | ** row = -1 | ||
+ | ** col = -1 | ||
+ | ** visited = False | ||
+ | ==== Methods ==== | ||
+ | * your 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 === | === Maze class === | ||
== Testing == | == Testing == |
Revision as of 12:32, 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
Directions
- Create two files for two classes named MazeRoom and Maze
MazeRoom class
Attributes
- Your MazeRoom should have the following attributes with default values:
- roomToNorth = None
- roomToSouth = None
- roomToEast = None
- roomToWest = None
- row = -1
- col = -1
- visited = False
Methods
- your 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