From 0daa0360d510e2a1b32eb55f856933aadf69061f Mon Sep 17 00:00:00 2001 From: bnewbold Date: Thu, 13 Dec 2012 22:43:14 +0100 Subject: initial commit --- bytetunes.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 bytetunes.py (limited to 'bytetunes.py') diff --git a/bytetunes.py b/bytetunes.py new file mode 100644 index 0000000..1d2a8a7 --- /dev/null +++ b/bytetunes.py @@ -0,0 +1,17 @@ + +from expr import * + +import sys + +def play(s): + machine = parse(preparse(tokenize(s))[0]) + t = 0 + while True: + t += 1 + sys.stdout.write(chr(execute(machine, t) & 0x000000FF)) + +def main(): + play("(t>>6)&(2*t)&(t>>1)") + +if __name__=='__main__': + main() -- cgit v1.2.3