Last active
May 9, 2021 13:23
-
-
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.
This file contains hidden or 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
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