File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1- "in progress"
21import sys
32try : code = open (sys .argv [1 ]).read ()
43except : print (f"Usage: python { __file__ .split (chr (0x5c ))[- 1 ]} \" (file name)\" " );exit ()
5- p = 0 ;ts = [];s = []
4+ p = 0 ; ts = []; s = []
65while 1 :
76 if code [p ] == '"' :
87 p += 1 ;s .append (code [p : code .index ('"' , p )])
1110 elif code [p ] == "," : s .append (input ())
1211 elif code [p ] in "0123456789" : s .append (int (code [p ]))
1312 elif code [p ] == "[" : p = code .index ("]" , p )
13+ elif code [p ] == "+" : s .append (int (s .pop ())+ int (s .pop ()))
14+ elif code [p ] == "-" : s .pop ()
15+ elif code [p ] == "`" : s .append (int (s .pop ())* - 1 )
16+ elif code [p ] == ":" : s .append (s [- 1 ])
1417 if code [p ] == "\n " : break
15- if len (code ) == p + 1 : p = - 1
18+ if len (code ) == p + 1 : p = - 1
1619 p += 1
You can’t perform that action at this time.
0 commit comments