Created
March 8, 2017 13:03
-
-
Save chpapa/9eb9a82d5ee6f34ddea9a56404901f25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from statemachine import StateMachine | |
print "Hi " + name + ", I am Ben." | |
contexts = { | |
"startups": "I'm Ben, co-founder of Oursky, which is a team of 40 developers and designers in Hong Kong and Taipei, we develop products for software developers.", | |
"ngo": "I run a small app studio, I’m also an advocate for creative commons, open data, citizen journalist and Internet freedom." | |
} | |
class BadDayStateMachine(StateMachine): | |
def __init__(self): | |
self.setInitialState("help") | |
def help(self): | |
print("So how are you doing?") | |
if input == "good": | |
self.transist("late") | |
def late(self): | |
print("Great! I am late for a meeting, let's catch up next time!") | |
print contexts[context] | |
BadDayStateMachine().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment