@property<EOL><INDENT>def start(self):<DEDENT>
self.initGrid()<EOL>self.win.clear()<EOL>self.state = '<STR_LIT>'<EOL>while self.state == '<STR_LIT>':<EOL><INDENT>if self.hud:<EOL><INDENT>self.drawHUD()<EOL><DEDENT>self.drawGrid()<EOL>self.nextGen()<EOL>sleep(self.rate)<EOL>if self.change_gen[<NUM_LIT:0>] == self.change_gen[<NUM_LIT:2>]:<EOL><INDENT>self.state = '<STR_LIT>'<EOL>break<EOL><DEDENT>key = self.win.getch()<EOL>if key == ord('<STR_LIT:q>'):<EOL><INDENT>exit()<EOL><DEDENT>if key == ord('<STR_LIT:r>'):<EOL><INDENT>self.restart<EOL><DEDENT>if key in [ord('<STR_LIT:p>'), ord('<STR_LIT:s>')]:<EOL><INDENT>self.state = '<STR_LIT>'<EOL>while self.state == '<STR_LIT>':<EOL><INDENT>key = self.win.getch()<EOL>if key == ord('<STR_LIT:q>'):<EOL><INDENT>exit()<EOL><DEDENT>if key == ord('<STR_LIT:r>'):<EOL><INDENT>self.state = '<STR_LIT>'<EOL>self.restart<EOL><DEDENT>if key in [ord('<STR_LIT:s>'), ord('<STR_LIT:p>')]:<EOL><INDENT>self.state = '<STR_LIT>'<EOL><DEDENT><DEDENT><DEDENT><DEDENT>self.end()<EOL>
Game logic