Skip to content

Instantly share code, notes, and snippets.

@gatukgl
Last active May 9, 2021 13:23
Show Gist options
  • Save gatukgl/951e82eeffb59da03fa16513f6b2a659 to your computer and use it in GitHub Desktop.
Save gatukgl/951e82eeffb59da03fa16513f6b2a659 to your computer and use it in GitHub Desktop.
This code intend to be an example of Python code before having Pattern Matching.
def interact(action):
command = action.split()[0]
if command == "walking":
direction = action.split()[1]
goTo(direction)
elif command == "pickup":
item = action.split()[1]
save(item)
elif command == "quit":
quitGame()
else:
print("😐 Don't know this command")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment