Difference between revisions of "Python - Maze Generation Assignment"

From WLCS
Line 10: Line 10:
 
* [http://gwydir.demon.co.uk/jo/maze/makemaze/index.htm Maze Designer]
 
* [http://gwydir.demon.co.uk/jo/maze/makemaze/index.htm Maze Designer]
  
== Directions ==
+
== MazeRoom class  ==
* Create two files for two classes named '''MazeRoom''' and '''Maze'''
+
* Create a file named '''MazeRoom.py''' for the MazeRoom class
 
+
=== Attributes ===
=== MazeRoom class ===
+
* MazeRoom should have the following attributes with default values:
==== Attributes ====
 
* Your MazeRoom should have the following attributes with default values:
 
 
** roomToNorth = None
 
** roomToNorth = None
 
** roomToSouth = None
 
** roomToSouth = None
Line 23: Line 21:
 
** col = -1
 
** col = -1
 
** visited = False
 
** visited = False
==== Methods ====
+
=== Methods ===
* your MazeRoom should have the following method:
+
* 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
 
** '''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 ==
 +
* Create a file named '''Maze.py''' for the Maze class
 +
=== Attributes ===
 +
 
 +
=== Methods ===
  
 
== Testing ==
 
== Testing ==

Revision as of 12:34, 16 May 2013

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 = None
    • roomToSouth = None
    • roomToEast = None
    • roomToWest = None
    • row = -1
    • col = -1
    • visited = False

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

Attributes

Methods

Testing