aboutsummaryrefslogtreecommitdiffstats
path: root/bytetunes.py
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2012-12-13 22:43:14 +0100
committerbnewbold <bnewbold@robocracy.org>2012-12-13 22:43:14 +0100
commit0daa0360d510e2a1b32eb55f856933aadf69061f (patch)
treeb37b8b25690af0ac1e277e5d5cb46c8fd2551a80 /bytetunes.py
downloadbytetunes-0daa0360d510e2a1b32eb55f856933aadf69061f.tar.gz
bytetunes-0daa0360d510e2a1b32eb55f856933aadf69061f.zip
initial commit
Diffstat (limited to 'bytetunes.py')
-rw-r--r--bytetunes.py17
1 files changed, 17 insertions, 0 deletions
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()