File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 11import sys
2- try : code = open (sys .argv [1 ]).read ()
2+ try :
3+ code = open (sys .argv [1 ]).read ()
4+ try : i = open (sys .argv [2 ]).readlines ()
5+ except : i = []
36except : print (f"Usage: python { __file__ .split (chr (0x5c ))[- 1 ]} \" (file name)\" " );exit ()
47p = 0 ; ts = []; s = []
58if not code : code = " "
69while 1 :
710 if code [p ] == '"' :
8- p += 1 ;s .append (code [p : code .index ('"' , p )])
11+ p += 1 ; s .append (code [p : code .index ('"' , p )])
912 p = code .index ('"' , p )
1013 elif code [p ] == "." : print (s .pop ())
11- elif code [p ] == "," : s .append (input ())
14+ elif code [p ] == "," :
15+ if i : s .append (i .pop ())
16+ else : raise EOFError ("Input reached an EOF" )
1217 elif code [p ] in "0123456789" : s .append (int (code [p ]))
1318 elif code [p ] == "[" : p = code .index ("]" , p )
1419 elif code [p ] == "+" : s .append (int (s .pop ())+ int (s .pop ()))
You can’t perform that action at this time.
0 commit comments