Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Player(object):
- def __init__(self):
- self.firstword = 'ready'
- self.action = 'start'
- def __getattribute__(self, actionname):
- if actionname != object.__getattribute__(self, 'firstword'):
- return object.__getattribute__(self, actionname)
- return object.__getattribute__(self, 'newaction')
- def newaction(self, nextact, word):
- self.firstword = word
- self.action = nextact
- def Play(Game):
- play = Player()
- while True:
- getattr(Game, play.action)(play)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement