|
@@ -181,7 +181,7 @@ class Maze(object):
|
181
|
181
|
"""
|
182
|
182
|
x0, y0 = cell
|
183
|
183
|
x1, y1 = neighbor
|
184
|
|
- # vertikal #
|
|
184
|
+ # vertikal
|
185
|
185
|
if x0 == x1:
|
186
|
186
|
x = x0
|
187
|
187
|
y = (y0 + y1) / 2
|
|
@@ -217,8 +217,8 @@ class Maze(object):
|
217
|
217
|
|
218
|
218
|
|
219
|
219
|
#ZUSATZ: OPTIONEN/HILFEN
|
220
|
|
-if __name__ == '__main__': #optparse wird eingesetzt, um den jeweiligen Stand/Status abzufragen
|
221
|
|
-
|
|
220
|
+if __name__ == '__main__': #optparse laesst dich die jeweiligen Parameter in der
|
|
221
|
+ #command line aendern
|
222
|
222
|
from optparse import OptionParser
|
223
|
223
|
|
224
|
224
|
parser = OptionParser(description="Random maze game")
|
|
@@ -230,7 +230,7 @@ if __name__ == '__main__': #optparse wird eingesetzt, um den jeweiligen S
|
230
|
230
|
help="cell size (default 10)")
|
231
|
231
|
args, _ = parser.parse_args()
|
232
|
232
|
|
233
|
|
- for arg in ('width', 'height'): #Option verfuegbar, die Hoehe und Breite zu aendern
|
|
233
|
+ for arg in ('width', 'height'):
|
234
|
234
|
if getattr(args, arg) % 2 == 0:
|
235
|
235
|
setattr(args, arg, getattr(args, arg) + 1)
|
236
|
236
|
print "Warning: %s muss ungerade sein, benutze %d stattdessen" % \
|