I am learning Python using the "Learn Python the Hard Way" book by Zed Shaw<http://learnpythonthehardway.org/>. I reached exercise 42 where we learn about Python classes<http://learnpythonthehardway.org/book/ex42.html>. The exercise shows a game with one class that includes all the definitions for playing the game. For extra credit we are asked to create another version of this game where we use two classes - one for the room definitions and the other for the playing the game.
May attempt at creating two classes is here http://codepad.org/963vUgSt . I get the following error which I have been un-able to resolve. Any suggestions are welcome. Traceback (most recent call last): File "ex42_3.py", line 233, in <module> run() File "ex42_3.py", line 231, in run room1.doIt() # plays the game File "ex42_3.py", line 32, in doIt self.obj.play() # use object File "ex42_3.py", line 20, in play room = getattr(self, next) AttributeError: 'Engine' object has no attribute 'central_corridor' Tonu
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor