Last active
August 29, 2015 14:01
-
-
Save dariusf/60c00e82211531e458ad to your computer and use it in GitHub Desktop.
CodeCombat Io integration example
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
# Create Player prototype | |
Player := Object clone | |
Player moveRight := method(writeln(self name .. " moved right")) | |
# Instantiate player | |
player := Player clone | |
player name := "Bob" | |
player actions := method( | |
# Insert user's code here | |
moveRight # resolves to 'self moveRight' via prototype chain: | |
# locals -> self -> Player -> Object -> Lobby | |
) | |
# Run | |
player actions # "Bob moved right" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment