learn python the hard way exercise 42 help

eryksun () eryksun at gmail.com
Wed Mar 30 10:24:43 EDT 2011


On Wednesday, March 30, 2011 9:48:29 AM UTC-4, neil harper wrote:
> http://pastie.org/1735028
> hey guys play is confusing me, i get how next gets the first room, which
> is passed when the instance of Game() is created, but how does it get
> the next room?
> 
> thanks

Each room is a method of Game. The returned value of each room is a reference to another room, depending on some condition. play() just loops the following: call room(); store the return reference as next; assign next to room. This continues until death(), which randomly insults you and quits.



More information about the Python-list mailing list