Skip to content

Instantly share code, notes, and snippets.

@worldofchris
Last active December 11, 2015 21:38
Show Gist options
  • Save worldofchris/4663638 to your computer and use it in GitHub Desktop.
Save worldofchris/4663638 to your computer and use it in GitHub Desktop.
Adder 0.2 - Snake based language...for adding. Inspired by @MegaStoat
"""Adder 0.2 - Snake based language...for adding"""
class Snake:
"""The main body of the adder"""
skin = '>'
def __init__(self):
self.body = ''
def add(self):
self.body += self.skin
def __str__(self):
return unicode(self.body).encode('utf-8')
def main():
snake = Snake()
while (1):
command = raw_input()
if command == 'add':
snake.add()
print snake
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment