Mercurial > repo
changeset 4722:bae2f2ac536b
<mroman> sed -e \'s/^M//g\' bin/rawpy > bin/rawpy
author | HackBot |
---|---|
date | Thu, 31 Jul 2014 18:05:09 +0000 |
parents | 5fec544d8821 |
children | 639bb98fd2e0 |
files | bin/rawpy |
diffstat | 1 files changed, 0 insertions(+), 48 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/rawpy Thu Jul 31 18:04:01 2014 +0000 +++ b/bin/rawpy Thu Jul 31 18:05:09 2014 +0000 @@ -1,48 +0,0 @@ -#!/usr/bin/python -import sys -if(len(sys.argv) > 1): - code = sys.argv[1] -else: - print "No, no...." - quit() - -i = 0 -l = len(code) -stack = [] -ac = 0 -regs = [0,0,0] -while i < l: - c = code[i] - if(c == '('): - stack.append(i) - elif(c == ')'): - if(ac != 0): - if(len(stack) > 0): - i = stack.pop() - continue - else: - print "No, no, no...." - quit() - elif(c == '+'): - ac += 1 - elif(c == '-'): - ac -= 1 - elif(c == 'O'): - print ac - elif(c == 'o'): - print chr(ac % 256) - elif(c == '*'): - ac = ac * 2 - elif(c == '0'): - ac = regs[0] - elif(c == '1'): - ac = regs[1] - elif(c == '2'): - ac = regs[2] - elif(c == 'a'): - regs[0] = ac - elif(c == 'b'): - regs[1] = ac - elif(c == 'c'): - regs[2] = c - i += 1