Last active
December 11, 2015 21:38
-
-
Save worldofchris/4663638 to your computer and use it in GitHub Desktop.
Adder 0.2 - Snake based language...for adding. Inspired by @MegaStoat
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
"""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