Skip to content

Commit 8949c03

Browse files
authored
Update tpy.py
1 parent dd5e9a6 commit 8949c03

File tree

1 file changed

+5
-33
lines changed

1 file changed

+5
-33
lines changed

true/tpy.py

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,9 @@
11
import sys
22
try:code=open(sys.argv[1]).read()
3-
except:print(f"Usage: py {__file__.split(chr(0x5c))[-1]} \"(file name)\"");exit()
3+
except:print(f"Usage: python {__file__.split(chr(0x5c))[-1]} \"(file name)\"");exit()
44
targ="";c="";sub=tp=p=0;ts=[];s=[];ld=[]
5-
print("true")
65
while 1:
7-
try:
8-
if code[p]=='"':
9-
while code[p+1]!='"':p+=1;ts.append(code[p])
10-
s.append("".join(ts));ts.clear();p+=1
11-
elif code[p]=='.':print(s.pop(),end="")
12-
elif code[p]in list(map(str,range(10))):s.append(int(code[p]))
13-
elif code[p]==',':c=input()
14-
elif code[p]==':':s.append(s[-1])
15-
elif code[p]=="'":s.append(c[0]);c=c[1:]
16-
elif code[p]=='»':
17-
targ=code[p+1];tp=p;sub=1
18-
while 1:
19-
if code[p]==targ and code[p+1]==":":p+=1;break
20-
if len(code)-2==p:p=0
21-
p+=1
22-
elif code[p]==";"and sub==1:p=tp
23-
elif code[p]=="\n":break
24-
elif code[p]=="-":s.pop()
25-
elif code[p]=="+":s.append(int(s.pop())+int(s.pop()))
26-
elif code[p]=="`":s.append(int(s.pop())*-1)
27-
elif code[p]=="(":
28-
while code[p+1]!=")":ts.append(code[p+1]);p+=1
29-
ld.append("".join(ts))
30-
elif code[p]=="[":
31-
while code[p]!="]":p+=1
32-
if len(code)-1==p:
33-
while 1:
34-
if code[p]=="\n":break
35-
elif p==0:p=-1
36-
p+=1
37-
except IndexError:break
6+
if code[p]=='"':p+=1;s.append(code[p:code.index('"',p)]);p=code.index('"',p)
7+
elif code[p]==".":print(s.pop())
8+
if code[p]=="\n":break
9+
p+=1

0 commit comments

Comments
 (0)