Skip to content

Instantly share code, notes, and snippets.

@dariusf
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dariusf/60c00e82211531e458ad to your computer and use it in GitHub Desktop.
Save dariusf/60c00e82211531e458ad to your computer and use it in GitHub Desktop.
CodeCombat Io integration example
# 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