Advertisement
RasterPython

Seabass Penta Interpreter v0.43

Jul 4th, 2019
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 77.90 KB | None | 0 0
  1. import sys
  2. import warnings
  3. from random import uniform
  4. import os,glob
  5. from math import fabs
  6.  
  7. #*Seabass Penta Interpreter v 0.43*#
  8.  
  9. if not sys.warnoptions:
  10.     warnings.simplefilter("ignore")
  11. #CLASSES START
  12. class INDENTATION_ERR(Exception):
  13.     pass
  14. class FUNCTION_ERR(Exception):
  15.     pass
  16. class GOTOPOINT_ERR(Exception):
  17.     pass
  18. #CLASSES END
  19. #FUNCTIONS START
  20. def errorprint(code,position):
  21.     code=code[0:position]+"("+code[position]+")"+code[position+1:]
  22.     code+=" "*5
  23.     code = 5*" "+code
  24.     text = code[position:position+13].replace(" ","")
  25.     return("\nThe error had occurred at position "+str(position)+": "+text)
  26. def indreturn(code):
  27.     starts=0
  28.     for x in ["!","=","<","[","]","{",".","k"]:
  29.         starts+=code.count(x)
  30.     ends=code.count(">")
  31.     return(starts-ends)
  32. def delcomment(text):#CHECK FOR CONSOLE ERR
  33.     while text.count("/")!=0:
  34.             counter = text.find("/")+1
  35.             while counter!=len(text) and text[counter]!="/" and text[counter]!="\n":
  36.                 counter+=1
  37.             text = text.replace(text[text.find("/"):counter+1],"", 1)
  38.     return text
  39. def indcheck(code):
  40.     code = delcomment(code)
  41.     starts=0
  42.     for x in ["!","=","<","[","]","{",".","k"]:
  43.         starts+=code.count(x)
  44.     ends=code.count(">")
  45.     if starts!=ends:
  46.         if starts>ends:
  47.             raise INDENTATION_ERR("Missing '>' mark(s)")
  48.         else:
  49.             raise INDENTATION_ERR("Excessive '>' mark(s)")
  50. def finder(tup):
  51.     code=tup[0]
  52.     f=tup[1]
  53.     dep=0
  54.     if f=="NoneType": f=0
  55.     while f!=len(code):
  56.         if ["k","=","<","!","{","[","]",".",","].count(code[f])!=0: dep+=1#if ["k","=","<","!","{","[","]"].count(code[f])!=0: dep+=1
  57.         elif code[f]==">": dep-=1
  58.         if dep==0 and code[f]==">":
  59.             return(f)
  60.         f+=1
  61. def innerfun(code1,funst,a):
  62.     mycode = source
  63.     mycode = mycode.replace('code = str(input(">> "))',"code=code1",1)
  64.     mycode = mycode.replace("funst=[]","funst="+str(funst),1)
  65.     mycode = mycode.replace("ex"+"tst","innerextst")
  66.     mycode = mycode.replace("ex1tst","extst")
  67.     mycode = mycode.replace("a=[0.0]","a=["+str(a)+"]")
  68.     mycode = "global extst\n"+mycode
  69.     exec(mycode+"\ntempvar=a[an];global tempvar")
  70. def innerfun2(code1,funst,a):
  71.     global source,declarations
  72.     mycode = declarations+source
  73.     mycode = mycode.replace("funst=[]","funst="+str(funst),1)
  74.     mycode = mycode.replace("ex"+"tst","innerextst")
  75.     mycode = mycode.replace("ex1tst","extst")
  76.     mycode = mycode.replace("a=[0.0]","a=["+str(a)+"]")
  77.     mycode = "global extst\n"+mycode
  78.     exec("global tempvar;code=code1\n"+mycode+"\ntempvar=a[an]")
  79. def boolcust(inp):
  80.     if inp<=0:
  81.         return(False)
  82.     else:
  83.         return(True)
  84. def converter(b):
  85.     if isinstance(b,str): return(float(ord(b[0])))
  86.     elif isinstance(b,int): return(float(b))
  87.     elif isinstance(b,float): return(float(b))
  88.     elif isinstance(b,bool): return(float(int(b)))
  89. def inputype(c):
  90.     try:
  91.         c=float(c)
  92.     except ValueError:
  93.         c=str(c)
  94.         c=float(ord(c[0]))
  95.     return(c)
  96. def comment(d):
  97.     while d.count("/")>1:
  98.         d=d[:d.find("/")]+d[d.find("/",d.find("/")+1)+1:]
  99.     if d.count("/")==1:
  100.         d=d[0:d.find("/")]
  101.     return(d)
  102. def filemaker(content,name):
  103.     f = open(name,"w")
  104.     f.write(content)
  105.     f.close()
  106. def fileapp(content,name):
  107.     f = open(name,"a")
  108.     f.write(content)
  109.     f.close()
  110. def filereader(name):
  111.     f = open(name,"r")
  112.     toreturn= f.read()
  113.     f.close()
  114.     return(toreturn)
  115. def findnumber(string,index):
  116.     allnums=[]
  117.     foc=0
  118.     num=False
  119.     while foc!=len(string):
  120.         if not num and ["1","2","3","4","5","6","7","8","9",".","0","-"].count(string[foc])!=0:
  121.             allnums.append(string[foc])
  122.             num=True
  123.         elif num and ["1","2","3","4","5","6","7","8","9",".","0"].count(string[foc])!=0:
  124.             allnums[-1]+=string[foc]
  125.         else:
  126.             if len(allnums)!=0:
  127.                 if allnums[-1][-1]=="-":
  128.                     allnums.pop()
  129.             num=False
  130.             if len(allnums)!=0:
  131.                 if allnums[-1][-1]=="-":
  132.                     allnums.pop()
  133.         foc+=1
  134.     return(allnums[int(index)])
  135. def countnums(text):
  136.     out=0
  137.     chars=["k","=","<","!","{","[","]","."]
  138.     for f in range(len(chars)): out+=text.count(chars[f])
  139.     out-=text.count(">")
  140.     return(out)
  141. def findnew(code, f):
  142.     code+="~"
  143.     balance=0
  144.     while f!=len(code):
  145.         if ["k","=","<","!","{","[","]","."].count(code[f])!=0:
  146.             balance+=1
  147.         elif code[f]==">":
  148.             balance-=1
  149.         if balance==0 and code[f+1]!="," and code[f+1]!="." and code[f]!="," and code[f]!=".":
  150.             return(f)
  151.         f+=1
  152. def findnew2(code,f):
  153.     balance=0
  154.     while f!=len(code):
  155.         if ["k","=","<","!","{","[","]","."].count(code[f])!=0:
  156.             balance+=1
  157.         elif code[f]==">":
  158.             balance-=1
  159.         if balance==0:
  160.             return(f)
  161.         f+=1
  162. def ifchecker(code,f):
  163.     coderev=code[::-1]
  164.     frev=len(code)-f-1
  165.     for m in ["=","<","!","{","[","]","."]:
  166.         if coderev.find("k",frev)==-1:
  167.             return(True)
  168.         if coderev.find(m,frev)<coderev.find("k",frev) and coderev.find(m,frev)!=-1:
  169.             return(True)
  170.     return(False)
  171. #FUNCTIONS END
  172. #DECLARATIONS START
  173. declarations ="""a=[0.0]
  174. d=[0.0]
  175. an=0
  176. dn=0
  177. extst=[]
  178. funst=[]
  179. gotost=[]
  180. gotopst=[]
  181. f=0
  182. globool=False
  183. ifcount=[]
  184. gotonum = 0
  185. ifmode = []
  186. endbool=False\n"""
  187. #DECLARATIONS END
  188. #SOURCE START
  189. source = r'''global outbool
  190. codest=[]
  191. while f!=len(code):
  192.    if code[f]=="@":
  193.        break
  194.    elif code[f]=="i":
  195.        a[an]+=1
  196.    elif code[f]=="I":
  197.        a[an]+=d[dn]
  198.    elif code[f]=="o":
  199.        print(a[an])
  200.        outbool = False
  201.    elif code[f]=="O":
  202.        if a[an]<0:
  203.            if fabs(a[an])<len(extst):
  204.                print(extst[int(fabs(a[an]))])
  205.                if str(extst[int(fabs(a[an]))])[-1]=="\n":
  206.                    outbool=False
  207.                else:
  208.                    outbool=True
  209.            else:
  210.                print("0",end="")
  211.                outbool=True
  212.        elif a[an]<len(extst):
  213.            print(extst[int(a[an])],end="")
  214.            if str(extst[int(fabs(a[an]))])[-1]=="\n":
  215.                outbool=False
  216.            else:
  217.                outbool=True
  218.        else:
  219.            print("0",end="")
  220.            outbool=True
  221.    elif code[f]=="d":
  222.        a[an]-=1
  223.    elif code[f]=="D":
  224.        a[an]-=d[dn]
  225.    elif code[f]=="s":
  226.        a[an]*=a[an]
  227.    elif code[f]=="S":
  228.        a[an] = a[an]**d[dn]
  229.    elif code[f]=="g":
  230.        a[an]=-a[an]
  231.    elif code[f]=="G":
  232.        d[dn]=-d[dn]
  233.    elif code[f]=="?":
  234.        a[an]=float(uniform(a[an], d[dn]))
  235.    elif code[f]=="v":
  236.        a[an]=a[an]/d[dn]
  237.    elif code[f]=="V":
  238.        a[an]=d[dn]/a[an]
  239.    elif code[f]=="r":
  240.        a[an]=a[an]**0.5
  241.    elif code[f]=="R":
  242.        a[an] = a[an]**(1/d[dn])
  243.    elif code[f]=="m":
  244.        a[an]=a[an]*d[dn]
  245.    elif code[f]=="M":
  246.        a[an]=float(a[an]%d[dn])
  247.    elif code[f]=="%":
  248.        a[an]=float(a[an]//d[dn])
  249.    elif code[f]=="c":
  250.        a[an]=d[dn]
  251.    elif code[f]=="C":
  252.        d[dn]=a[an]
  253.    elif code[f]=="p":
  254.        if a[an]<0: a[an]=-a[an]
  255.        else: pass
  256.    elif code[f]=="P":
  257.        if d[dn]<0: d[dn]=-d[dn]
  258.        else: pass
  259.    elif code[f]=="k":
  260.        if funst.count(int(a[an]))!=0: funst.pop(funst.index(int(a[an]))+1);funst.pop(funst.index(int(a[an])))
  261.        funst.append(int(a[an]));funst.append(code[f+1:finder([code,f])])
  262.        f = finder([code,f])
  263.        ifmode.append(f)
  264.    elif code[f]=="a":
  265.        if an+1==len(a):
  266.            a.append(0.0)
  267.        an+=1
  268.    elif code[f]=="A":
  269.        an+=int(d[dn])
  270.        if an+d[dn]>=len(a):
  271.            exec("a.append(0.0);"*(an-len(a)+1))
  272.    elif code[f]=="b":
  273.        dn+=1
  274.        if len(d)==dn:
  275.            d.append(0.0)
  276.    elif code[f]=="B":
  277.        dn+=int(a[an])
  278.        if len(d)<=dn:
  279.            exec("d.append(0.0);"*(dn-len(d)+1))
  280.    elif code[f]=="x" or code[f]=="X":
  281.        temp = a[an];a[an]=d[dn];d[dn]=temp;del temp
  282.    elif code[f]=="z":
  283.        an=0
  284.    elif code[f]=="Z":
  285.        dn=0
  286.    elif code[f]=="h":
  287.        codest.append(code);codest.append(f+1)
  288.        f=-1
  289.        if not globool:
  290.            code = extst[int(a[an])];indcheck(code)
  291.        else:
  292.            code = ex1tst[int(a[an])];indcheck(code)
  293.    elif code[f]=="H":
  294.        try: innerfun2(funst[funst.index(int(a[an]))+1],funst,d[dn])
  295.        except ValueError: raise FUNCTION_ERR("No such function "+'"'+str(int(a[an]))+'". '+errorprint(code,f))
  296.        d[dn]=tempvar
  297.    elif code[f]=="K":
  298.        globool = not globool
  299.    elif code[f]=="n":
  300.        if not globool:
  301.            if len(extst)<=int(d[dn]):
  302.                exec("extst.append(0);"*(int(d[dn])-len(extst)+1))
  303.            extst[int(d[dn])]=int(int(a[an]))
  304.        else:
  305.            if len(ex1tst)<=int(d[dn]):
  306.                exec("ex1tst.append(0);"*(int(d[dn])-len(ex1tst)+1))
  307.            ex1tst[int(d[dn])]=int(int(a[an]))
  308.    elif code[f]=="N":
  309.        if not globool:
  310.            if len(extst)<=int(a[an]):
  311.                exec("extst.append(0);"*(int(a[an])-len(extst)+1))
  312.            extst[int(a[an])]=int(int(d[dn]))
  313.        else:
  314.            if len(ex1tst)<=int(a[an]):
  315.                exec("ex1tst.append(0);"*(int(a[an])-len(ex1tst)+1))
  316.            ex1tst[int(a[an])]=int(int(d[dn]))
  317.    elif code[f]=="f":
  318.        if not globool:
  319.            if len(extst)<=int(d[dn]):
  320.                exec("extst.append(0);"*(int(d[dn])-len(extst)+1))
  321.            extst[int(d[dn])]=a[an]
  322.        else:
  323.            if len(ex1tst)<=int(d[dn]):
  324.                exec("ex1tst.append(0);"*(int(d[dn])-len(ex1tst)+1))
  325.            ex1tst[int(d[dn])]=a[an]
  326.    elif code[f]=="F":
  327.        if not globool:
  328.            if len(extst)<=int(a[an]):
  329.                exec("extst.append(0);"*(int(a[an])-len(extst)+1))
  330.            extst[int(a[an])]=d[dn]
  331.        else:
  332.            if len(ex1tst)<=int(a[an]):
  333.                exec("ex1tst.append(0);"*(int(a[an])-len(ex1tst)+1))
  334.            ex1tst[int(a[an])]=d[dn]
  335.    elif code[f]=="t":
  336.        if not globool:
  337.            if len(extst)<=fabs(int(d[dn])):
  338.                exec("extst.append(0);"*int(fabs(int(d[dn]))-len(extst)+1))
  339.            if d[dn]>=0: extst[int(d[dn])]=chr(int(a[an]))
  340.            else: extst[-int(d[dn])]=str(int(a[an]))
  341.        else:
  342.            if len(ex1tst)<=int(fabs(d[dn])):
  343.                exec("ex1tst.append(0);"*int(fabs(int(d[dn]))-len(ex1tst)+1))
  344.            if d[dn]>=0: ex1tst[int(d[dn])]=chr(int(a[an]))
  345.            else: ex1tst[-int(d[dn])]=str(int(a[an]))
  346.    elif code[f]=="T":
  347.        if not globool:
  348.            if len(extst)<=int(fabs(d[dn])):
  349.                exec("extst.append(0);"*int(int(fabs(d[dn]))-len(extst)+1))
  350.            if d[dn]>=0:
  351.                if extst[int(d[dn])]!=0: extst[int(d[dn])]+=chr(int(a[an]))
  352.                else: extst[int(d[dn])]=chr(int(a[an]))
  353.            else:
  354.                extst[-int(d[dn])] = a[an]
  355.        else:
  356.            if len(ex1tst)<=int(fabs(d[dn])):
  357.                exec("ex1tst.append(0);"*int(fabs(int(d[dn]))-len(ex1tst)+1))
  358.            if d[dn]>=0:
  359.                if ex1tst[int(d[dn])]!=0: ex1tst[int(d[dn])]+=chr(int(a[an]))
  360.                else: ex1tst[int(d[dn])]=chr(int(a[an]))
  361.            else:
  362.                ex1tst[-int(d[dn])] = a[an]
  363.    elif code[f]=="e":
  364.        if not globool:
  365.            if len(extst)<=int(d[dn]):
  366.                exec("extst.append(0);"*(int(d[dn])-len(extst)+1))
  367.            extst[int(d[dn])]=boolcust(a[an])
  368.        else:
  369.            if len(ex1tst)<=int(d[dn]):
  370.                exec("ex1tst.append(0);"*(int(d[dn])-len(ex1tst)+1))
  371.            ex1tst[int(d[dn])]=boolcust(a[an])
  372.    elif code[f]=="E":
  373.        if not globool:
  374.            if len(extst)<=int(a[an]):
  375.                exec("extst.append(0);"*(int(a[an])-len(extst)+1))
  376.            extst[int(a[an])]=boolcust(d[dn])
  377.        else:
  378.            if len(ex1tst)<=int(a[an]):
  379.                exec("ex1tst.append(0);"*(int(a[an])-len(ex1tst)+1))
  380.            ex1tst[int(a[an])]=boolcust(d[dn])
  381.    elif code[f]=="q":
  382.        a[an]=inputype(input("?> "))
  383.    elif code[f]=="Q":
  384.        if not globool:
  385.            if len(extst)<=int(a[an]):
  386.                exec("extst.append(0);"*(int(a[an])-len(extst)+1))
  387.            try: extst[int(a[an])]=str(input(extst[int(d[dn])]))
  388.            except TypeError: extst[int(a[an])]=str(input())
  389.        else:
  390.            if len(ex1tst)<=int(a[an]):
  391.                exec("ex1tst.append(0);"*(int(a[an])-len(ex1tst)+1))
  392.            try: ex1tst[int(a[an])]=str(input(ex1tst[int(d[dn])]))
  393.            except TypeError: ex1tst[int(a[an])]=str(input())
  394.    elif code[f]=="l":
  395.        if not globool:
  396.            if len(extst)<=int(d[dn]):
  397.                exec("extst.append(0);"*(int(d[dn])-len(extst)+1))
  398.            a[an]=converter(extst[int(d[dn])])
  399.        else:
  400.            if len(ex1tst)<=int(d[dn]):
  401.                exec("ex1tst.append(0);"*(int(d[dn])-len(ex1tst)+1))
  402.            an[an]=converter(ex1tst[int(d[dn])])
  403.    elif code[f]=="w":
  404.        if not globool:
  405.            if a[an]>=0:
  406.                filemaker(extst[int(a[an])],extst[int(d[dn])])
  407.            else:
  408.                filemaker(chr(int(a[an])),extst[int(d[dn])])
  409.        else:
  410.            if a[an]>=0:
  411.                filemaker(ex1tst[int(a[an])],ex1tst[int(d[dn])])
  412.            else:
  413.                filemaker(chr(int(a[an])),ex1tst[int(d[dn])])
  414.    elif code[f]=="W":
  415.        if not globool:
  416.            if a[an]>=0:
  417.                fileapp(extst[int(a[an])],extst[int(d[dn])])
  418.            else:
  419.                fileapp(chr(int(a[an])),extst[int(d[dn])])
  420.        else:
  421.            if a[an]>=0:
  422.                fileapp(ex1tst[int(a[an])],ex1tst[int(d[dn])])
  423.            else:
  424.                fileapp(chr(int(a[an])),ex1tst[int(d[dn])])
  425.    elif code[f]=="y":
  426.        if not globool:
  427.            extst[int(a[an])]=filereader(extst[int(d[dn])])
  428.        else:
  429.            ex1tst[int(a[an])]=filereader(ex1tst[int(d[dn])])
  430.    elif code[f]=="Y":
  431.        if not globool:
  432.            extst[int(a[an])]+=filereader(extst[int(d[dn])])
  433.        else:
  434.            ex1tst[int(a[an])]+=filereader(ex1tst[int(d[dn])])
  435.    elif code[f]=="#" or code[f]=="L":
  436.        if not globool:
  437.            try: a[an]=float(ord(extst[int(a[an])][int(d[dn])]))
  438.            except IndexError: a[an]=-1.0
  439.        else:
  440.            try: a[an]=float(ord(ex1tst[int(a[an])][int(d[dn])]))
  441.            except IndexError: a[an]=-1.0
  442.    elif code[f]=="№" or code[f]=="$":
  443.        if not globool: a[an]=float(findnumber(extst[int(a[an])],d[dn]))
  444.        else: a[an]=float(findnumber(ex1tst[int(a[an])],d[dn]))
  445.    elif code[f]=="=":
  446.        if a[an]==d[dn]:
  447.            ifcount.append(findnew(code,f))
  448.        else:
  449.            f = findnew2(code,f)
  450.    elif code[f]=="<":
  451.        if a[an]<d[dn]:
  452.            ifcount.append(findnew(code,f))
  453.        else:
  454.            f = findnew2(code,f)
  455.    elif code[f]=="!":
  456.        if a[an]!=d[dn]:
  457.            ifcount.append(findnew(code,f))
  458.        else:
  459.            f = findnew2(code,f)
  460.    elif code[f]=="{":
  461.        if a[an]<=d[dn]:
  462.            ifcount.append(findnew(code,f))
  463.        else:
  464.            f = findnew2(code,f)
  465.    elif code[f]=="[":
  466.        if not globool:
  467.            if extst[int(a[an])]:
  468.                ifcount.append(findnew(code,f))
  469.            else:
  470.                f = findnew2(code,f)
  471.        else:
  472.            if ex1tst[int(a[an])]:
  473.                ifcount.append(findnew(code,f))
  474.            else:
  475.                f = findnew2(code,f)
  476.    elif code[f]=="]":
  477.        if not globool:
  478.            if not extst[int(a[an])]:
  479.                ifcount.append(findnew(code,f))
  480.            else:
  481.                f = findnew2(code,f)
  482.        else:
  483.            if not ex1tst[int(a[an])]:
  484.                ifcount.append(findnew(code,f))
  485.            else:
  486.                f = findnew2(code,f)
  487.    elif code[f]==".":
  488.        ifcount.append(findnew(code,f))
  489.    elif code[f]==">":
  490.        if len(ifcount)!=0:
  491.            if ifchecker(code,f): f = ifcount.pop()
  492.    elif code[f]==":":
  493.        if gotopst.count(int(a[an]))!=0: f+=1;continue
  494.        if gotost.count(int(a[an]))!=0: gotost.pop(gotost.index(int(a[an]))+1);gotost.pop(gotost.index(int(a[an])))
  495.        gotost.append(int(a[an]))
  496.        gotost.append(str(f))
  497.    elif code[f]==";":
  498.        if gotopst.count(int(a[an]))!=0 or gotopst.count(int(f))!=0 or gotost.count(int(a[an]))!=0:
  499.            pass
  500.        else:
  501.            gotopst.append(int(a[an]))
  502.            gotopst.append(str(f))
  503.    elif code[f]=="j":
  504.        if gotost.count(int(a[an]))!=0:
  505.            exec('ifcount.pop();'*countnums(code[int(gotost[gotost.index(int(a[an]))+1])+1:f]))
  506.            f = int(gotost[gotost.index(int(a[an]))+1])
  507.        else:
  508.            try: f = exec('ifcount.pop();'*countnums(code[int(gotopst[gotopst.index(int(a[an]))+1])+1:f]))
  509.            except ValueError: raise GOTOPOINT_ERR("No such goto point "+'"'+str(int(a[an]))+'". '+errorprint(code,f))
  510.            f = int(gotopst[gotopst.index(int(a[an]))+1])
  511.    elif code[f]=="J":
  512.        if not globool:
  513.            if len(extst)<=int(a[an]):
  514.                exec("extst.append(0);"*(int(a[an])-len(extst)+1))
  515.            if a[an]>=0:
  516.                if gotost.count(a[an])<1:
  517.                    extst[int(d[dn])] = code[int(gotopst[gotopst.index(int(a[an]))+1]):]
  518.                else:
  519.                    extst[int(d[dn])] = code[int(gotost[gotost.index(int(a[an]))+1]):]
  520.            else:
  521.                if gotost.count(a[an])<1:
  522.                    extst[-int(d[dn])] = code[int(gotopst[gotopst.index(int(a[an]))+1])+1:]
  523.                else:
  524.                    extst[-int(d[dn])] = code[int(gotost[gotost.index(int(a[an]))+1])+1:]
  525.        else:
  526.            if len(ex1tst)<=int(a[an]):
  527.                exec("ex1tst.append(0);"*(int(a[an])-len(ex1tst)+1))
  528.            if a[an]>=0:
  529.                if gotost.count(a[an])<1:
  530.                    extst[int(d[dn])] = code[int(gotopst[gotopst.index(int(a[an]))+1]):]
  531.                else:
  532.                    ex1tst[int(d[dn])] = code[int(gotost[gotost.index(int(a[an]))+1]):]
  533.            else:
  534.                if gotost.count(a[an])<1:
  535.                    ex1tst[-int(d[dn])] = code[int(gotopst[gotopst.index(int(a[an]))+1])+1:]
  536.                else:
  537.                    ex1tst[-int(d[dn])] = code[int(gotost[gotost.index(int(a[an]))+1])+1:]
  538.    elif code[f]=="/":####COMMENT
  539.        if code.find("/",f+1)==-1:
  540.            if code.find("\n",f+1)==-1: f = len(code)-1
  541.            else: f = f = code.find("\n",f+1)
  542.        elif code.find("\n",f+1)!=-1 and code.find("/",f+1)>code.find("\n",f+1):
  543.            f = code.find("\n",f+1)
  544.        else:
  545.            f = code.find("/",f+1)
  546.    f+=1
  547.    if f==len(code) and len(codest)!=0:
  548.        f = codest.pop()
  549.        code = codest.pop()'''
  550. #SOURCE END
  551. print("Welcome to Seabas Penta Interpreter v0.32")
  552. while 1:
  553.     print("Select option:\n[0] - quit\n[1] - go to Seabass console\n[2] - open a .dfs file")
  554.     option = int(input("Option : "))
  555.     if option==0:
  556.         import sys;sys.exit()
  557.     elif option==1:
  558.         a=[0.0]
  559.         d=[0.0]
  560.         an=0
  561.         dn=0
  562.         extst=[]
  563.         funst=[]
  564.         gotost=[]
  565.         gotopst=[]
  566.         f=0
  567.         globool=False
  568.         tempvar=None
  569.         ifcount=[]
  570.         gotonum = 0
  571.         ifmode = []
  572.         endbool=False
  573.         code=""
  574.         outbool=False
  575.         contbool=False
  576.         codest=[]
  577.         print("═"*29+"╕")#WORKTAG
  578.         while not endbool:
  579.             if not contbool:
  580.                 input1 = str(input(">> "))
  581.             else:
  582.                 input1 = str(input(".. "))
  583.             if len(input1)!=0 and input1[-1]==" " or indreturn(delcomment(code+input1))>0:#LATEST CHANGE
  584.                 code+=input1+"\n"
  585.                 contbool=True
  586.             else:
  587.                 contbool=False
  588.                 code+=input1
  589.                 indcheck(code)
  590.                 while f!=len(code):
  591.                     if code[f]=="@":
  592.                         endbool=True
  593.                         break
  594.                     elif code[f]=="i":
  595.                         a[an]+=1
  596.                     elif code[f]=="I":
  597.                         a[an]+=d[dn]
  598.                     elif code[f]=="o":
  599.                         print(a[an])
  600.                         outbool = False
  601.                     elif code[f]=="O":
  602.                         if a[an]<0:
  603.                             if fabs(a[an])<len(extst):
  604.                                 print(extst[int(fabs(a[an]))])
  605.                                 if str(extst[int(fabs(a[an]))])[-1]=="\n":
  606.                                     outbool=False
  607.                                 else:
  608.                                     outbool=True
  609.                             else:
  610.                                 print("0",end="")
  611.                                 outbool=True
  612.                         elif a[an]<len(extst):
  613.                             print(extst[int(a[an])],end="")
  614.                             if str(extst[int(fabs(a[an]))])[-1]=="\n":
  615.                                 outbool=False
  616.                             else:
  617.                                 outbool=True
  618.                         else:
  619.                             print("0",end="")
  620.                             outbool=True
  621.                     elif code[f]=="d":
  622.                         a[an]-=1
  623.                     elif code[f]=="D":
  624.                         a[an]-=d[dn]
  625.                     elif code[f]=="s":
  626.                         a[an]*=a[an]
  627.                     elif code[f]=="S":
  628.                         a[an] = a[an]**d[dn]
  629.                     elif code[f]=="g":
  630.                         a[an]=-a[an]
  631.                     elif code[f]=="G":
  632.                         d[dn]=-d[dn]
  633.                     elif code[f]=="?":
  634.                         a[an]=float(uniform(a[an], d[dn]))
  635.                     elif code[f]=="v":
  636.                         a[an]=a[an]/d[dn]
  637.                     elif code[f]=="V":
  638.                         a[an]=d[dn]/a[an]
  639.                     elif code[f]=="r":
  640.                         a[an]=a[an]**0.5
  641.                     elif code[f]=="R":
  642.                         a[an] = a[an]**(1/d[dn])
  643.                     elif code[f]=="m":
  644.                         a[an]=a[an]*d[dn]
  645.                     elif code[f]=="M":
  646.                         a[an]=float(a[an]%d[dn])
  647.                     elif code[f]=="%":
  648.                         a[an]=float(a[an]//d[dn])
  649.                     elif code[f]=="c":
  650.                         a[an]=d[dn]
  651.                     elif code[f]=="C":
  652.                         d[dn]=a[an]
  653.                     elif code[f]=="p":
  654.                         if a[an]<0: a[an]=-a[an]
  655.                         else: pass
  656.                     elif code[f]=="P":
  657.                         if d[dn]<0: d[dn]=-d[dn]
  658.                         else: pass
  659.                     elif code[f]=="k":
  660.                         if funst.count(int(a[an]))!=0: funst.pop(funst.index(int(a[an]))+1);funst.pop(funst.index(int(a[an])))
  661.                         funst.append(int(a[an]));funst.append(code[f+1:finder([code,f])])
  662.                         f = finder([code,f])
  663.                         ifmode.append(f)
  664.                     elif code[f]=="a":
  665.                         if an+1==len(a):
  666.                             a.append(0.0)
  667.                         an+=1
  668.                     elif code[f]=="A":
  669.                         an+=int(d[dn])
  670.                         if an+d[dn]>=len(a):
  671.                             exec("a.append(0.0);"*(an-len(a)+1))
  672.                     elif code[f]=="b":
  673.                         dn+=1
  674.                         if len(d)==dn:
  675.                             d.append(0.0)
  676.                     elif code[f]=="B":
  677.                         dn+=int(a[an])
  678.                         if len(d)<=dn:
  679.                             exec("d.append(0.0);"*(dn-len(d)+1))
  680.                     elif code[f]=="x" or code[f]=="X":
  681.                         temp = a[an];a[an]=d[dn];d[dn]=temp;del temp
  682.                     elif code[f]=="z":
  683.                         an=0
  684.                     elif code[f]=="Z":
  685.                         dn=0
  686.                     elif code[f]=="h":
  687.                         codest.append(code);codest.append(f+1)
  688.                         f=-1
  689.                         if not globool:
  690.                             code = extst[int(a[an])];indcheck(code)
  691.                         else:
  692.                             code = ex1tst[int(a[an])];indcheck(code)
  693.                     elif code[f]=="H":
  694.                         try: innerfun2(funst[funst.index(int(a[an]))+1],funst,d[dn])
  695.                         except ValueError: raise FUNCTION_ERR("No such function "+'"'+str(int(a[an]))+'". '+errorprint(code,f))
  696.                         d[dn]=tempvar
  697.                     elif code[f]=="K":
  698.                         globool = not globool
  699.                     elif code[f]=="n":
  700.                         if not globool:
  701.                             if len(extst)<=int(d[dn]):
  702.                                 exec("extst.append(0);"*(int(d[dn])-len(extst)+1))
  703.                             extst[int(d[dn])]=int(int(a[an]))
  704.                         else:
  705.                             if len(ex1tst)<=int(d[dn]):
  706.                                 exec("ex1tst.append(0);"*(int(d[dn])-len(ex1tst)+1))
  707.                             ex1tst[int(d[dn])]=int(int(a[an]))
  708.                     elif code[f]=="N":
  709.                         if not globool:
  710.                             if len(extst)<=int(a[an]):
  711.                                 exec("extst.append(0);"*(int(a[an])-len(extst)+1))
  712.                             extst[int(a[an])]=int(int(d[dn]))
  713.                         else:
  714.                             if len(ex1tst)<=int(a[an]):
  715.                                 exec("ex1tst.append(0);"*(int(a[an])-len(ex1tst)+1))
  716.                             ex1tst[int(a[an])]=int(int(d[dn]))
  717.                     elif code[f]=="f":
  718.                         if not globool:
  719.                             if len(extst)<=int(d[dn]):
  720.                                 exec("extst.append(0);"*(int(d[dn])-len(extst)+1))
  721.                             extst[int(d[dn])]=a[an]
  722.                         else:
  723.                             if len(ex1tst)<=int(d[dn]):
  724.                                 exec("ex1tst.append(0);"*(int(d[dn])-len(ex1tst)+1))
  725.                             ex1tst[int(d[dn])]=a[an]
  726.                     elif code[f]=="F":
  727.                         if not globool:
  728.                             if len(extst)<=int(a[an]):
  729.                                 exec("extst.append(0);"*(int(a[an])-len(extst)+1))
  730.                             extst[int(a[an])]=d[dn]
  731.                         else:
  732.                             if len(ex1tst)<=int(a[an]):
  733.                                 exec("ex1tst.append(0);"*(int(a[an])-len(ex1tst)+1))
  734.                             ex1tst[int(a[an])]=d[dn]
  735.                     elif code[f]=="t":
  736.                         if not globool:
  737.                             if len(extst)<=fabs(int(d[dn])):
  738.                                 exec("extst.append(0);"*int(fabs(int(d[dn]))-len(extst)+1))
  739.                             if d[dn]>=0: extst[int(d[dn])]=chr(int(a[an]))
  740.                             else: extst[-int(d[dn])]=str(int(a[an]))
  741.                         else:
  742.                             if len(ex1tst)<=int(fabs(d[dn])):
  743.                                 exec("ex1tst.append(0);"*int(fabs(int(d[dn]))-len(ex1tst)+1))
  744.                             if d[dn]>=0: ex1tst[int(d[dn])]=chr(int(a[an]))
  745.                             else: ex1tst[-int(d[dn])]=str(int(a[an]))
  746.                     elif code[f]=="T":
  747.                         if not globool:
  748.                             if len(extst)<=int(fabs(d[dn])):
  749.                                 exec("extst.append(0);"*int(int(fabs(d[dn]))-len(extst)+1))
  750.                             if d[dn]>=0:
  751.                                 if extst[int(d[dn])]!=0: extst[int(d[dn])]+=chr(int(a[an]))
  752.                                 else: extst[int(d[dn])]=chr(int(a[an]))
  753.                             else:
  754.                                 extst[-int(d[dn])] = a[an]
  755.                         else:
  756.                             if len(ex1tst)<=int(fabs(d[dn])):
  757.                                 exec("ex1tst.append(0);"*int(fabs(int(d[dn]))-len(ex1tst)+1))
  758.                             if d[dn]>=0:
  759.                                 if ex1tst[int(d[dn])]!=0: ex1tst[int(d[dn])]+=chr(int(a[an]))
  760.                                 else: ex1tst[int(d[dn])]=chr(int(a[an]))
  761.                             else:
  762.                                 ex1tst[-int(d[dn])] = a[an]
  763.                     elif code[f]=="e":
  764.                         if not globool:
  765.                             if len(extst)<=int(d[dn]):
  766.                                 exec("extst.append(0);"*(int(d[dn])-len(extst)+1))
  767.                             extst[int(d[dn])]=boolcust(a[an])
  768.                         else:
  769.                             if len(ex1tst)<=int(d[dn]):
  770.                                 exec("ex1tst.append(0);"*(int(d[dn])-len(ex1tst)+1))
  771.                             ex1tst[int(d[dn])]=boolcust(a[an])
  772.                     elif code[f]=="E":
  773.                         if not globool:
  774.                             if len(extst)<=int(a[an]):
  775.                                 exec("extst.append(0);"*(int(a[an])-len(extst)+1))
  776.                             extst[int(a[an])]=boolcust(d[dn])
  777.                         else:
  778.                             if len(ex1tst)<=int(a[an]):
  779.                                 exec("ex1tst.append(0);"*(int(a[an])-len(ex1tst)+1))
  780.                             ex1tst[int(a[an])]=boolcust(d[dn])
  781.                     elif code[f]=="q":
  782.                         a[an]=inputype(input("?> "))
  783.                     elif code[f]=="Q":
  784.                         if not globool:
  785.                             if len(extst)<=int(a[an]):
  786.                                 exec("extst.append(0);"*(int(a[an])-len(extst)+1))
  787.                             try: extst[int(a[an])]=str(input(extst[int(d[dn])]))
  788.                             except TypeError: extst[int(a[an])]=str(input())
  789.                         else:
  790.                             if len(ex1tst)<=int(a[an]):
  791.                                 exec("ex1tst.append(0);"*(int(a[an])-len(ex1tst)+1))
  792.                             try: ex1tst[int(a[an])]=str(input(ex1tst[int(d[dn])]))
  793.                             except TypeError: ex1tst[int(a[an])]=str(input())
  794.                     elif code[f]=="l":
  795.                         if not globool:
  796.                             if len(extst)<=int(d[dn]):
  797.                                 exec("extst.append(0);"*(int(d[dn])-len(extst)+1))
  798.                             a[an]=converter(extst[int(d[dn])])
  799.                         else:
  800.                             if len(ex1tst)<=int(d[dn]):
  801.                                 exec("ex1tst.append(0);"*(int(d[dn])-len(ex1tst)+1))
  802.                             an[an]=converter(ex1tst[int(d[dn])])
  803.                     elif code[f]=="w":
  804.                         if not globool:
  805.                             if a[an]>=0:
  806.                                 filemaker(extst[int(a[an])],extst[int(d[dn])])
  807.                             else:
  808.                                 filemaker(chr(int(a[an])),extst[int(d[dn])])
  809.                         else:
  810.                             if a[an]>=0:
  811.                                 filemaker(ex1tst[int(a[an])],ex1tst[int(d[dn])])
  812.                             else:
  813.                                 filemaker(chr(int(a[an])),ex1tst[int(d[dn])])
  814.                     elif code[f]=="W":
  815.                         if not globool:
  816.                             if a[an]>=0:
  817.                                 fileapp(extst[int(a[an])],extst[int(d[dn])])
  818.                             else:
  819.                                 fileapp(chr(int(a[an])),extst[int(d[dn])])
  820.                         else:
  821.                             if a[an]>=0:
  822.                                 fileapp(ex1tst[int(a[an])],ex1tst[int(d[dn])])
  823.                             else:
  824.                                 fileapp(chr(int(a[an])),ex1tst[int(d[dn])])
  825.                     elif code[f]=="y":
  826.                         if not globool:
  827.                             extst[int(a[an])]=filereader(extst[int(d[dn])])
  828.                         else:
  829.                             ex1tst[int(a[an])]=filereader(ex1tst[int(d[dn])])
  830.                     elif code[f]=="Y":
  831.                         if not globool:
  832.                             extst[int(a[an])]+=filereader(extst[int(d[dn])])
  833.                         else:
  834.                             ex1tst[int(a[an])]+=filereader(ex1tst[int(d[dn])])
  835.                     elif code[f]=="#" or code[f]=="L":
  836.                         if not globool:
  837.                             try: a[an]=float(ord(extst[int(a[an])][int(d[dn])]))
  838.                             except IndexError: a[an]=-1.0
  839.                         else:
  840.                             try: a[an]=float(ord(ex1tst[int(a[an])][int(d[dn])]))
  841.                             except IndexError: a[an]=-1.0
  842.                     elif code[f]=="№" or code[f]=="$":
  843.                         if not globool: a[an]=float(findnumber(extst[int(a[an])],d[dn]))
  844.                         else: a[an]=float(findnumber(ex1tst[int(a[an])],d[dn]))
  845.                     elif code[f]=="=":
  846.                         if a[an]==d[dn]:
  847.                             ifcount.append(findnew(code,f))
  848.                         else:
  849.                             f = findnew2(code,f)
  850.                     elif code[f]=="<":
  851.                         if a[an]<d[dn]:
  852.                             ifcount.append(findnew(code,f))
  853.                         else:
  854.                             f = findnew2(code,f)
  855.                     elif code[f]=="!":
  856.                         if a[an]!=d[dn]:
  857.                             ifcount.append(findnew(code,f))
  858.                         else:
  859.                             f = findnew2(code,f)
  860.                     elif code[f]=="{":
  861.                         if a[an]<=d[dn]:
  862.                             ifcount.append(findnew(code,f))
  863.                         else:
  864.                             f = findnew2(code,f)
  865.                     elif code[f]=="[":
  866.                         if not globool:
  867.                             if extst[int(a[an])]:
  868.                                 ifcount.append(findnew(code,f))
  869.                             else:
  870.                                 f = findnew2(code,f)
  871.                         else:
  872.                             if ex1tst[int(a[an])]:
  873.                                 ifcount.append(findnew(code,f))
  874.                             else:
  875.                                 f = findnew2(code,f)
  876.                     elif code[f]=="]":
  877.                         if not globool:
  878.                             if not extst[int(a[an])]:
  879.                                 ifcount.append(findnew(code,f))
  880.                             else:
  881.                                 f = findnew2(code,f)
  882.                         else:
  883.                             if not ex1tst[int(a[an])]:
  884.                                 ifcount.append(findnew(code,f))
  885.                             else:
  886.                                 f = findnew2(code,f)
  887.                     elif code[f]==".":
  888.                         ifcount.append(findnew(code,f))
  889.                     elif code[f]==">":
  890.                         if len(ifcount)!=0:
  891.                             if ifchecker(code,f): f = ifcount.pop()
  892.                     elif code[f]==":":
  893.                         if gotopst.count(int(a[an]))!=0: f+=1;continue
  894.                         if gotost.count(int(a[an]))!=0: gotost.pop(gotost.index(int(a[an]))+1);gotost.pop(gotost.index(int(a[an])))
  895.                         gotost.append(int(a[an]))
  896.                         gotost.append(str(f))
  897.                     elif code[f]==";":
  898.                         if gotopst.count(int(a[an]))!=0 or gotopst.count(int(f))!=0 or gotost.count(int(a[an]))!=0:
  899.                             pass
  900.                         else:
  901.                             gotopst.append(int(a[an]))
  902.                             gotopst.append(str(f))
  903.                     elif code[f]=="j":
  904.                         if gotost.count(int(a[an]))!=0:
  905.                             exec('ifcount.pop();'*countnums(code[int(gotost[gotost.index(int(a[an]))+1])+1:f]))
  906.                             f = int(gotost[gotost.index(int(a[an]))+1])
  907.                         else:
  908.                             try: f = exec('ifcount.pop();'*countnums(code[int(gotopst[gotopst.index(int(a[an]))+1])+1:f]))
  909.                             except ValueError: raise GOTOPOINT_ERR("No such goto point "+'"'+str(int(a[an]))+'". '+errorprint(code,f))
  910.                             f = int(gotopst[gotopst.index(int(a[an]))+1])
  911.                     elif code[f]=="J":
  912.                         if not globool:
  913.                             if len(extst)<=int(a[an]):
  914.                                 exec("extst.append(0);"*(int(a[an])-len(extst)+1))
  915.                             if a[an]>=0:
  916.                                 if gotost.count(a[an])<1:
  917.                                     extst[int(d[dn])] = code[int(gotopst[gotopst.index(int(a[an]))+1]):]
  918.                                 else:
  919.                                     extst[int(d[dn])] = code[int(gotost[gotost.index(int(a[an]))+1]):]
  920.                             else:
  921.                                 if gotost.count(a[an])<1:
  922.                                     extst[-int(d[dn])] = code[int(gotopst[gotopst.index(int(a[an]))+1])+1:]
  923.                                 else:
  924.                                     extst[-int(d[dn])] = code[int(gotost[gotost.index(int(a[an]))+1])+1:]
  925.                         else:
  926.                             if len(ex1tst)<=int(a[an]):
  927.                                 exec("ex1tst.append(0);"*(int(a[an])-len(ex1tst)+1))
  928.                             if a[an]>=0:
  929.                                 if gotost.count(a[an])<1:
  930.                                     extst[int(d[dn])] = code[int(gotopst[gotopst.index(int(a[an]))+1]):]
  931.                                 else:
  932.                                     ex1tst[int(d[dn])] = code[int(gotost[gotost.index(int(a[an]))+1]):]
  933.                             else:
  934.                                 if gotost.count(a[an])<1:
  935.                                     ex1tst[-int(d[dn])] = code[int(gotopst[gotopst.index(int(a[an]))+1])+1:]
  936.                                 else:
  937.                                     ex1tst[-int(d[dn])] = code[int(gotost[gotost.index(int(a[an]))+1])+1:]
  938.                     elif code[f]=="/":####COMMENT
  939.                         if code.find("/",f+1)==-1:
  940.                             if code.find("\n",f+1)==-1: f = len(code)-1
  941.                             else: f = f = code.find("\n",f+1)
  942.                         elif code.find("\n",f+1)!=-1 and code.find("/",f+1)>code.find("\n",f+1):
  943.                             f = code.find("\n",f+1)
  944.                         else:
  945.                             f = code.find("/",f+1)
  946.                     f+=1
  947.                     if f==len(code) and len(codest)!=0:
  948.                         f = codest.pop()
  949.                         code = codest.pop()
  950.                 if outbool: print("",end=None);outbool=False
  951.                 f=0
  952.                 code=""
  953.         print("═"*29+"╛")#WORKTAG
  954.     else:
  955.         ####FILEWORKS
  956.         curdir = os.path.dirname(os.path.realpath(__file__))
  957.         os.chdir(curdir)
  958.         filelist = []
  959.         print("Select file for interpretation:")
  960.         for file in glob.glob('*.dfs'):
  961.             filelist.append(file)
  962.         if len(filelist)==0:
  963.             print("Error: no files found")
  964.             sys.exit()
  965.         for file in range(len(filelist)):
  966.             print("["+str(file)+"] - "+filelist[file])
  967.         number = int(input("Option : "))
  968.         code = open(os.path.join(curdir,filelist[number])).read()
  969.         ####FILEWORKS
  970.         indcheck(code)
  971.         a=[0.0]
  972.         d=[0.0]
  973.         an=0
  974.         dn=0
  975.         extst=[]
  976.         funst=[]
  977.         gotost=[]
  978.         gotopst=[]
  979.         f=0
  980.         globool=False
  981.         tempvar=None
  982.         ifcount=[]
  983.         gotonum = 0
  984.         ifmode = []
  985.         endbool=False
  986.         outbool=False
  987.         codest=[]
  988.         print("═"*29+"╕")#WORKTAG
  989.         while f!=len(code):
  990.             if code[f]=="@":
  991.                 break
  992.             elif code[f]=="i":
  993.                 a[an]+=1
  994.             elif code[f]=="I":
  995.                 a[an]+=d[dn]
  996.             elif code[f]=="o":
  997.                 print(a[an])
  998.             elif code[f]=="O":
  999.                 if a[an]<0:
  1000.                     if fabs(a[an])<len(extst):
  1001.                         print(extst[int(fabs(a[an]))])
  1002.                         if str(extst[int(fabs(a[an]))])[-1]=="\n":
  1003.                             outbool=False
  1004.                         else:
  1005.                             outbool=True
  1006.                     else:
  1007.                         print("0",end="")
  1008.                         outbool=True
  1009.                 elif a[an]<len(extst):
  1010.                     print(extst[int(a[an])],end="")
  1011.                     if str(extst[int(fabs(a[an]))])[-1]=="\n":
  1012.                         outbool=False
  1013.                     else:
  1014.                         outbool=True
  1015.                 else:
  1016.                     print("0",end="")
  1017.                     outbool=True
  1018.             elif code[f]=="d":
  1019.                 a[an]-=1
  1020.             elif code[f]=="D":
  1021.                 a[an]-=d[dn]
  1022.             elif code[f]=="s":
  1023.                 a[an]*=a[an]
  1024.             elif code[f]=="S":
  1025.                 a[an] = a[an]**d[dn]
  1026.             elif code[f]=="g":
  1027.                 a[an]=-a[an]
  1028.             elif code[f]=="G":
  1029.                 d[dn]=-d[dn]
  1030.             elif code[f]=="?":
  1031.                 a[an]=float(uniform(a[an], d[dn]))
  1032.             elif code[f]=="v":
  1033.                 a[an]=a[an]/d[dn]
  1034.             elif code[f]=="V":
  1035.                 a[an]=d[dn]/a[an]
  1036.             elif code[f]=="r":
  1037.                 a[an]=a[an]**0.5
  1038.             elif code[f]=="R":
  1039.                 a[an] = a[an]**(1/d[dn])
  1040.             elif code[f]=="m":
  1041.                 a[an]=a[an]*d[dn]
  1042.             elif code[f]=="M":
  1043.                 a[an]=float(a[an]%d[dn])
  1044.             elif code[f]=="%":
  1045.                 a[an]=float(a[an]//d[dn])
  1046.             elif code[f]=="c":
  1047.                 a[an]=d[dn]
  1048.             elif code[f]=="C":
  1049.                 d[dn]=a[an]
  1050.             elif code[f]=="p":
  1051.                 if a[an]<0: a[an]=-a[an]
  1052.                 else: pass
  1053.             elif code[f]=="P":
  1054.                 if d[dn]<0: d[dn]=-d[dn]
  1055.                 else: pass
  1056.             elif code[f]=="k":
  1057.                 if funst.count(int(a[an]))!=0: funst.pop(funst.index(int(a[an]))+1);funst.pop(funst.index(int(a[an])))
  1058.                 funst.append(int(a[an]));funst.append(code[f+1:finder([code,f])])
  1059.                 f = finder([code,f])
  1060.                 ifmode.append(f)
  1061.             elif code[f]=="a":
  1062.                 if an+1==len(a):
  1063.                     a.append(0.0)
  1064.                 an+=1
  1065.             elif code[f]=="A":
  1066.                 an+=int(d[dn])
  1067.                 if an+d[dn]>=len(a):
  1068.                     exec("a.append(0.0);"*(an-len(a)+1))
  1069.             elif code[f]=="b":
  1070.                 dn+=1
  1071.                 if len(d)==dn:
  1072.                     d.append(0.0)
  1073.             elif code[f]=="B":
  1074.                 dn+=int(a[an])
  1075.                 if len(d)<=dn:
  1076.                     exec("d.append(0.0);"*(dn-len(d)+1))
  1077.             elif code[f]=="x" or code[f]=="X":
  1078.                 temp = a[an];a[an]=d[dn];d[dn]=temp;del temp
  1079.             elif code[f]=="z":
  1080.                 an=0
  1081.             elif code[f]=="Z":
  1082.                 dn=0
  1083.             elif code[f]=="h":
  1084.                 codest.append(code);codest.append(f+1)
  1085.                 f=-1
  1086.                 if not globool:
  1087.                     code = extst[int(a[an])];indcheck(code)
  1088.                 else:
  1089.                     code = ex1tst[int(a[an])];indcheck(code)
  1090.             elif code[f]=="H":
  1091.                 try: innerfun2(funst[funst.index(int(a[an]))+1],funst,d[dn])
  1092.                 except ValueError: raise FUNCTION_ERR("No such function "+'"'+str(int(a[an]))+'". '+errorprint(code,f))
  1093.                 d[dn]=tempvar
  1094.             elif code[f]=="K":
  1095.                 globool = not globool
  1096.             elif code[f]=="n":
  1097.                 if not globool:
  1098.                     if len(extst)<=int(d[dn]):
  1099.                         exec("extst.append(0);"*(int(d[dn])-len(extst)+1))
  1100.                     extst[int(d[dn])]=int(int(a[an]))
  1101.                 else:
  1102.                     if len(ex1tst)<=int(d[dn]):
  1103.                         exec("ex1tst.append(0);"*(int(d[dn])-len(ex1tst)+1))
  1104.                     ex1tst[int(d[dn])]=int(int(a[an]))
  1105.             elif code[f]=="N":
  1106.                 if not globool:
  1107.                     if len(extst)<=int(a[an]):
  1108.                         exec("extst.append(0);"*(int(a[an])-len(extst)+1))
  1109.                     extst[int(a[an])]=int(int(d[dn]))
  1110.                 else:
  1111.                     if len(ex1tst)<=int(a[an]):
  1112.                         exec("ex1tst.append(0);"*(int(a[an])-len(ex1tst)+1))
  1113.                     ex1tst[int(a[an])]=int(int(d[dn]))
  1114.             elif code[f]=="f":
  1115.                 if not globool:
  1116.                     if len(extst)<=int(d[dn]):
  1117.                         exec("extst.append(0);"*(int(d[dn])-len(extst)+1))
  1118.                     extst[int(d[dn])]=a[an]
  1119.                 else:
  1120.                     if len(ex1tst)<=int(d[dn]):
  1121.                         exec("ex1tst.append(0);"*(int(d[dn])-len(ex1tst)+1))
  1122.                     ex1tst[int(d[dn])]=a[an]
  1123.             elif code[f]=="F":
  1124.                 if not globool:
  1125.                     if len(extst)<=int(a[an]):
  1126.                         exec("extst.append(0);"*(int(a[an])-len(extst)+1))
  1127.                     extst[int(a[an])]=d[dn]
  1128.                 else:
  1129.                     if len(ex1tst)<=int(a[an]):
  1130.                         exec("ex1tst.append(0);"*(int(a[an])-len(ex1tst)+1))
  1131.                     ex1tst[int(a[an])]=d[dn]
  1132.             elif code[f]=="t":
  1133.                 if not globool:
  1134.                     if len(extst)<=fabs(int(d[dn])):
  1135.                         exec("extst.append(0);"*int(fabs(int(d[dn]))-len(extst)+1))
  1136.                     if d[dn]>=0: extst[int(d[dn])]=chr(int(a[an]))
  1137.                     else: extst[-int(d[dn])]=str(int(a[an]))
  1138.                 else:
  1139.                     if len(ex1tst)<=int(fabs(d[dn])):
  1140.                         exec("ex1tst.append(0);"*int(fabs(int(d[dn]))-len(ex1tst)+1))
  1141.                     if d[dn]>=0: ex1tst[int(d[dn])]=chr(int(a[an]))
  1142.                     else: ex1tst[-int(d[dn])]=str(int(a[an]))
  1143.             elif code[f]=="T":
  1144.                 if not globool:
  1145.                     if len(extst)<=int(fabs(d[dn])):
  1146.                         exec("extst.append(0);"*int(int(fabs(d[dn]))-len(extst)+1))
  1147.                     if d[dn]>=0:
  1148.                         if extst[int(d[dn])]!=0: extst[int(d[dn])]+=chr(int(a[an]))
  1149.                         else: extst[int(d[dn])]=chr(int(a[an]))
  1150.                     else:
  1151.                         extst[-int(d[dn])] = a[an]
  1152.                 else:
  1153.                     if len(ex1tst)<=int(fabs(d[dn])):
  1154.                         exec("ex1tst.append(0);"*int(fabs(int(d[dn]))-len(ex1tst)+1))
  1155.                     if d[dn]>=0:
  1156.                         if ex1tst[int(d[dn])]!=0: ex1tst[int(d[dn])]+=chr(int(a[an]))
  1157.                         else: ex1tst[int(d[dn])]=chr(int(a[an]))
  1158.                     else:
  1159.                         ex1tst[-int(d[dn])] = a[an]
  1160.             elif code[f]=="e":
  1161.                 if not globool:
  1162.                     if len(extst)<=int(d[dn]):
  1163.                         exec("extst.append(0);"*(int(d[dn])-len(extst)+1))
  1164.                     extst[int(d[dn])]=boolcust(a[an])
  1165.                 else:
  1166.                     if len(ex1tst)<=int(d[dn]):
  1167.                         exec("ex1tst.append(0);"*(int(d[dn])-len(ex1tst)+1))
  1168.                     ex1tst[int(d[dn])]=boolcust(a[an])
  1169.             elif code[f]=="E":
  1170.                 if not globool:
  1171.                     if len(extst)<=int(a[an]):
  1172.                         exec("extst.append(0);"*(int(a[an])-len(extst)+1))
  1173.                     extst[int(a[an])]=boolcust(d[dn])
  1174.                 else:
  1175.                     if len(ex1tst)<=int(a[an]):
  1176.                         exec("ex1tst.append(0);"*(int(a[an])-len(ex1tst)+1))
  1177.                     ex1tst[int(a[an])]=boolcust(d[dn])
  1178.             elif code[f]=="q":
  1179.                 a[an]=inputype(input("?> "))
  1180.             elif code[f]=="Q":
  1181.                 if not globool:
  1182.                     if len(extst)<=int(a[an]):
  1183.                         exec("extst.append(0);"*(int(a[an])-len(extst)+1))
  1184.                     try: extst[int(a[an])]=str(input(extst[int(d[dn])]))
  1185.                     except TypeError: extst[int(a[an])]=str(input())
  1186.                 else:
  1187.                     if len(ex1tst)<=int(a[an]):
  1188.                         exec("ex1tst.append(0);"*(int(a[an])-len(ex1tst)+1))
  1189.                     try: ex1tst[int(a[an])]=str(input(ex1tst[int(d[dn])]))
  1190.                     except TypeError: ex1tst[int(a[an])]=str(input())
  1191.             elif code[f]=="l":
  1192.                 if not globool:
  1193.                     if len(extst)<=int(d[dn]):
  1194.                         exec("extst.append(0);"*(int(d[dn])-len(extst)+1))
  1195.                     a[an]=converter(extst[int(d[dn])])
  1196.                 else:
  1197.                     if len(ex1tst)<=int(d[dn]):
  1198.                         exec("ex1tst.append(0);"*(int(d[dn])-len(ex1tst)+1))
  1199.                     an[an]=converter(ex1tst[int(d[dn])])
  1200.             elif code[f]=="w":
  1201.                 if not globool:
  1202.                     if a[an]>=0:
  1203.                         filemaker(extst[int(a[an])],extst[int(d[dn])])
  1204.                     else:
  1205.                         filemaker(chr(int(a[an])),extst[int(d[dn])])
  1206.                 else:
  1207.                     if a[an]>=0:
  1208.                         filemaker(ex1tst[int(a[an])],ex1tst[int(d[dn])])
  1209.                     else:
  1210.                         filemaker(chr(int(a[an])),ex1tst[int(d[dn])])
  1211.             elif code[f]=="W":
  1212.                 if not globool:
  1213.                     if a[an]>=0:
  1214.                         fileapp(extst[int(a[an])],extst[int(d[dn])])
  1215.                     else:
  1216.                         fileapp(chr(int(a[an])),extst[int(d[dn])])
  1217.                 else:
  1218.                     if a[an]>=0:
  1219.                         fileapp(ex1tst[int(a[an])],ex1tst[int(d[dn])])
  1220.                     else:
  1221.                         fileapp(chr(int(a[an])),ex1tst[int(d[dn])])
  1222.             elif code[f]=="y":
  1223.                 if not globool:
  1224.                     extst[int(a[an])]=filereader(extst[int(d[dn])])
  1225.                 else:
  1226.                     ex1tst[int(a[an])]=filereader(ex1tst[int(d[dn])])
  1227.             elif code[f]=="Y":
  1228.                 if not globool:
  1229.                     extst[int(a[an])]+=filereader(extst[int(d[dn])])
  1230.                 else:
  1231.                     ex1tst[int(a[an])]+=filereader(ex1tst[int(d[dn])])
  1232.             elif code[f]=="#" or code[f]=="L":
  1233.                 if not globool:
  1234.                     try: a[an]=float(ord(extst[int(a[an])][int(d[dn])]))
  1235.                     except IndexError: a[an]=-1.0
  1236.                 else:
  1237.                     try: a[an]=float(ord(ex1tst[int(a[an])][int(d[dn])]))
  1238.                     except IndexError: a[an]=-1.0
  1239.             elif code[f]=="№" or code[f]=="$":
  1240.                 if not globool: a[an]=float(findnumber(extst[int(a[an])],d[dn]))
  1241.                 else: a[an]=float(findnumber(ex1tst[int(a[an])],d[dn]))
  1242.             elif code[f]=="=":
  1243.                 if a[an]==d[dn]:
  1244.                     ifcount.append(findnew(code,f))
  1245.                 else:
  1246.                     f = findnew2(code,f)
  1247.             elif code[f]=="<":
  1248.                 if a[an]<d[dn]:
  1249.                     ifcount.append(findnew(code,f))
  1250.                 else:
  1251.                     f = findnew2(code,f)
  1252.             elif code[f]=="!":
  1253.                 if a[an]!=d[dn]:
  1254.                     ifcount.append(findnew(code,f))
  1255.                 else:
  1256.                     f = findnew2(code,f)
  1257.             elif code[f]=="{":
  1258.                 if a[an]<=d[dn]:
  1259.                     ifcount.append(findnew(code,f))
  1260.                 else:
  1261.                     f = findnew2(code,f)
  1262.             elif code[f]=="[":
  1263.                 if not globool:
  1264.                     if extst[int(a[an])]:
  1265.                         ifcount.append(findnew(code,f))
  1266.                     else:
  1267.                         f = findnew2(code,f)
  1268.                 else:
  1269.                     if ex1tst[int(a[an])]:
  1270.                         ifcount.append(findnew(code,f))
  1271.                     else:
  1272.                         f = findnew2(code,f)
  1273.             elif code[f]=="]":
  1274.                 if not globool:
  1275.                     if not extst[int(a[an])]:
  1276.                         ifcount.append(findnew(code,f))
  1277.                     else:
  1278.                         f = findnew2(code,f)
  1279.                 else:
  1280.                     if not ex1tst[int(a[an])]:
  1281.                         ifcount.append(findnew(code,f))
  1282.                     else:
  1283.                         f = findnew2(code,f)
  1284.             elif code[f]==".":
  1285.                 ifcount.append(findnew(code,f))
  1286.             elif code[f]==">":
  1287.                 if len(ifcount)!=0:
  1288.                     if ifchecker(code,f): f = ifcount.pop()
  1289.             elif code[f]==":":
  1290.                 if gotopst.count(int(a[an]))!=0: f+=1;continue
  1291.                 if gotost.count(int(a[an]))!=0: gotost.pop(gotost.index(int(a[an]))+1);gotost.pop(gotost.index(int(a[an])))
  1292.                 gotost.append(int(a[an]))
  1293.                 gotost.append(str(f))
  1294.             elif code[f]==";":
  1295.                 if gotopst.count(int(a[an]))!=0 or gotopst.count(int(f))!=0 or gotost.count(int(a[an]))!=0:
  1296.                     pass
  1297.                 else:
  1298.                     gotopst.append(int(a[an]))
  1299.                     gotopst.append(str(f))
  1300.             elif code[f]=="j":
  1301.                 if gotost.count(int(a[an]))!=0:
  1302.                     exec('ifcount.pop();'*countnums(code[int(gotost[gotost.index(int(a[an]))+1])+1:f]))
  1303.                     f = int(gotost[gotost.index(int(a[an]))+1])
  1304.                 else:
  1305.                     try: f = exec('ifcount.pop();'*countnums(code[int(gotopst[gotopst.index(int(a[an]))+1])+1:f]))
  1306.                     except ValueError: raise GOTOPOINT_ERR("No such goto point "+'"'+str(int(a[an]))+'". '+errorprint(code,f))
  1307.                     f = int(gotopst[gotopst.index(int(a[an]))+1])
  1308.             elif code[f]=="J":
  1309.                 if not globool:
  1310.                     if len(extst)<=int(a[an]):
  1311.                         exec("extst.append(0);"*(int(a[an])-len(extst)+1))
  1312.                     if a[an]>=0:
  1313.                         if gotost.count(a[an])<1:
  1314.                             extst[int(d[dn])] = code[int(gotopst[gotopst.index(int(a[an]))+1]):]
  1315.                         else:
  1316.                             extst[int(d[dn])] = code[int(gotost[gotost.index(int(a[an]))+1]):]
  1317.                     else:
  1318.                         if gotost.count(a[an])<1:
  1319.                             extst[-int(d[dn])] = code[int(gotopst[gotopst.index(int(a[an]))+1])+1:]
  1320.                         else:
  1321.                             extst[-int(d[dn])] = code[int(gotost[gotost.index(int(a[an]))+1])+1:]
  1322.                 else:
  1323.                     if len(ex1tst)<=int(a[an]):
  1324.                         exec("ex1tst.append(0);"*(int(a[an])-len(ex1tst)+1))
  1325.                     if a[an]>=0:
  1326.                         if gotost.count(a[an])<1:
  1327.                             extst[int(d[dn])] = code[int(gotopst[gotopst.index(int(a[an]))+1]):]
  1328.                         else:
  1329.                             ex1tst[int(d[dn])] = code[int(gotost[gotost.index(int(a[an]))+1]):]
  1330.                     else:
  1331.                         if gotost.count(a[an])<1:
  1332.                             ex1tst[-int(d[dn])] = code[int(gotopst[gotopst.index(int(a[an]))+1])+1:]
  1333.                         else:
  1334.                             ex1tst[-int(d[dn])] = code[int(gotost[gotost.index(int(a[an]))+1])+1:]
  1335.             elif code[f]=="/":####COMMENT
  1336.                 if code.find("/",f+1)==-1:
  1337.                     if code.find("\n",f+1)==-1: f = len(code)-1
  1338.                     else: f = f = code.find("\n",f+1)
  1339.                 elif code.find("\n",f+1)!=-1 and code.find("/",f+1)>code.find("\n",f+1):
  1340.                     f = code.find("\n",f+1)
  1341.                 else:
  1342.                     f = code.find("/",f+1)
  1343.             f+=1
  1344.             if f==len(code) and len(codest)!=0:
  1345.                 f = codest.pop()
  1346.                 code = codest.pop()
  1347.         if outbool: print("",end=None);outbool=False
  1348.         print("═"*29+"╛")#WORKTAG
  1349.         print("End of "+filelist[number]+", choose option:\n[0] - quit\n[1] - initiate Seabass console\n[2] - continue")
  1350.         option = int(input("Option : "))
  1351.         if option==0:
  1352.             sys.exit()
  1353.         elif option==1:
  1354.             f=0
  1355.             globool=False
  1356.             code=""
  1357.             outbool=False
  1358.             contbool=False
  1359.             codest=[]
  1360.             print("═"*29+"╕")#WORKTAG
  1361.             while not endbool:
  1362.                 if not contbool:
  1363.                     input1 = str(input(">> "))
  1364.                 else:
  1365.                     input1 = str(input(".. "))
  1366.                 if len(input1)!=0 and input1[-1]==" " or indreturn(code+input1)>0:
  1367.                     code+=input1+"\n"
  1368.                     contbool=True
  1369.                 else:
  1370.                     contbool=False
  1371.                     code+=input1
  1372.                     indcheck(code)
  1373.                     while f!=len(code):
  1374.                         if code[f]=="@":
  1375.                             endbool=True
  1376.                             break
  1377.                         elif code[f]=="i":
  1378.                             a[an]+=1
  1379.                         elif code[f]=="I":
  1380.                             a[an]+=d[dn]
  1381.                         elif code[f]=="o":
  1382.                             print(a[an])
  1383.                             outbool = False
  1384.                         elif code[f]=="O":
  1385.                             if a[an]<0:
  1386.                                 if fabs(a[an])<len(extst):
  1387.                                     print(extst[int(fabs(a[an]))])
  1388.                                     if str(extst[int(fabs(a[an]))])[-1]=="\n":
  1389.                                         outbool=False
  1390.                                     else:
  1391.                                         outbool=True
  1392.                                 else:
  1393.                                     print("0",end="")
  1394.                                     outbool=True
  1395.                             elif a[an]<len(extst):
  1396.                                 print(extst[int(a[an])],end="")
  1397.                                 if str(extst[int(fabs(a[an]))])[-1]=="\n":
  1398.                                     outbool=False
  1399.                                 else:
  1400.                                     outbool=True
  1401.                             else:
  1402.                                 print("0",end="")
  1403.                                 outbool=True
  1404.                         elif code[f]=="d":
  1405.                             a[an]-=1
  1406.                         elif code[f]=="D":
  1407.                             a[an]-=d[dn]
  1408.                         elif code[f]=="s":
  1409.                             a[an]*=a[an]
  1410.                         elif code[f]=="S":
  1411.                             a[an] = a[an]**d[dn]
  1412.                         elif code[f]=="g":
  1413.                             a[an]=-a[an]
  1414.                         elif code[f]=="G":
  1415.                             d[dn]=-d[dn]
  1416.                         elif code[f]=="?":
  1417.                             a[an]=float(uniform(a[an], d[dn]))
  1418.                         elif code[f]=="v":
  1419.                             a[an]=a[an]/d[dn]
  1420.                         elif code[f]=="V":
  1421.                             a[an]=d[dn]/a[an]
  1422.                         elif code[f]=="r":
  1423.                             a[an]=a[an]**0.5
  1424.                         elif code[f]=="R":
  1425.                             a[an] = a[an]**(1/d[dn])
  1426.                         elif code[f]=="m":
  1427.                             a[an]=a[an]*d[dn]
  1428.                         elif code[f]=="M":
  1429.                             a[an]=float(a[an]%d[dn])
  1430.                         elif code[f]=="%":
  1431.                             a[an]=float(a[an]//d[dn])
  1432.                         elif code[f]=="c":
  1433.                             a[an]=d[dn]
  1434.                         elif code[f]=="C":
  1435.                             d[dn]=a[an]
  1436.                         elif code[f]=="p":
  1437.                             if a[an]<0: a[an]=-a[an]
  1438.                             else: pass
  1439.                         elif code[f]=="P":
  1440.                             if d[dn]<0: d[dn]=-d[dn]
  1441.                             else: pass
  1442.                         elif code[f]=="k":
  1443.                             if funst.count(int(a[an]))!=0: funst.pop(funst.index(int(a[an]))+1);funst.pop(funst.index(int(a[an])))
  1444.                             funst.append(int(a[an]));funst.append(code[f+1:finder([code,f])])
  1445.                             f = finder([code,f])
  1446.                             ifmode.append(f)
  1447.                         elif code[f]=="a":
  1448.                             if an+1==len(a):
  1449.                                 a.append(0.0)
  1450.                             an+=1
  1451.                         elif code[f]=="A":
  1452.                             an+=int(d[dn])
  1453.                             if an+d[dn]>=len(a):
  1454.                                 exec("a.append(0.0);"*(an-len(a)+1))
  1455.                         elif code[f]=="b":
  1456.                             dn+=1
  1457.                             if len(d)==dn:
  1458.                                 d.append(0.0)
  1459.                         elif code[f]=="B":
  1460.                             dn+=int(a[an])
  1461.                             if len(d)<=dn:
  1462.                                 exec("d.append(0.0);"*(dn-len(d)+1))
  1463.                         elif code[f]=="x" or code[f]=="X":
  1464.                             temp = a[an];a[an]=d[dn];d[dn]=temp;del temp
  1465.                         elif code[f]=="z":
  1466.                             an=0
  1467.                         elif code[f]=="Z":
  1468.                             dn=0
  1469.                         elif code[f]=="h":
  1470.                             codest.append(code);codest.append(f+1)
  1471.                             f=-1
  1472.                             if not globool:
  1473.                                 code = extst[int(a[an])];indcheck(code)
  1474.                             else:
  1475.                                 code = ex1tst[int(a[an])];indcheck(code)
  1476.                         elif code[f]=="H":
  1477.                             try: innerfun2(funst[funst.index(int(a[an]))+1],funst,d[dn])
  1478.                             except ValueError: raise FUNCTION_ERR("No such function "+'"'+str(int(a[an]))+'". '+errorprint(code,f))
  1479.                             d[dn]=tempvar
  1480.                         elif code[f]=="K":
  1481.                             globool = not globool
  1482.                         elif code[f]=="n":
  1483.                             if not globool:
  1484.                                 if len(extst)<=int(d[dn]):
  1485.                                     exec("extst.append(0);"*(int(d[dn])-len(extst)+1))
  1486.                                 extst[int(d[dn])]=int(int(a[an]))
  1487.                             else:
  1488.                                 if len(ex1tst)<=int(d[dn]):
  1489.                                     exec("ex1tst.append(0);"*(int(d[dn])-len(ex1tst)+1))
  1490.                                 ex1tst[int(d[dn])]=int(int(a[an]))
  1491.                         elif code[f]=="N":
  1492.                             if not globool:
  1493.                                 if len(extst)<=int(a[an]):
  1494.                                     exec("extst.append(0);"*(int(a[an])-len(extst)+1))
  1495.                                 extst[int(a[an])]=int(int(d[dn]))
  1496.                             else:
  1497.                                 if len(ex1tst)<=int(a[an]):
  1498.                                     exec("ex1tst.append(0);"*(int(a[an])-len(ex1tst)+1))
  1499.                                 ex1tst[int(a[an])]=int(int(d[dn]))
  1500.                         elif code[f]=="f":
  1501.                             if not globool:
  1502.                                 if len(extst)<=int(d[dn]):
  1503.                                     exec("extst.append(0);"*(int(d[dn])-len(extst)+1))
  1504.                                 extst[int(d[dn])]=a[an]
  1505.                             else:
  1506.                                 if len(ex1tst)<=int(d[dn]):
  1507.                                     exec("ex1tst.append(0);"*(int(d[dn])-len(ex1tst)+1))
  1508.                                 ex1tst[int(d[dn])]=a[an]
  1509.                         elif code[f]=="F":
  1510.                             if not globool:
  1511.                                 if len(extst)<=int(a[an]):
  1512.                                     exec("extst.append(0);"*(int(a[an])-len(extst)+1))
  1513.                                 extst[int(a[an])]=d[dn]
  1514.                             else:
  1515.                                 if len(ex1tst)<=int(a[an]):
  1516.                                     exec("ex1tst.append(0);"*(int(a[an])-len(ex1tst)+1))
  1517.                                 ex1tst[int(a[an])]=d[dn]
  1518.                         elif code[f]=="t":
  1519.                             if not globool:
  1520.                                 if len(extst)<=fabs(int(d[dn])):
  1521.                                     exec("extst.append(0);"*int(fabs(int(d[dn]))-len(extst)+1))
  1522.                                 if d[dn]>=0: extst[int(d[dn])]=chr(int(a[an]))
  1523.                                 else: extst[-int(d[dn])]=str(int(a[an]))
  1524.                             else:
  1525.                                 if len(ex1tst)<=int(fabs(d[dn])):
  1526.                                     exec("ex1tst.append(0);"*int(fabs(int(d[dn]))-len(ex1tst)+1))
  1527.                                 if d[dn]>=0: ex1tst[int(d[dn])]=chr(int(a[an]))
  1528.                                 else: ex1tst[-int(d[dn])]=str(int(a[an]))
  1529.                         elif code[f]=="T":
  1530.                             if not globool:
  1531.                                 if len(extst)<=int(fabs(d[dn])):
  1532.                                     exec("extst.append(0);"*int(int(fabs(d[dn]))-len(extst)+1))
  1533.                                 if d[dn]>=0:
  1534.                                     if extst[int(d[dn])]!=0: extst[int(d[dn])]+=chr(int(a[an]))
  1535.                                     else: extst[int(d[dn])]=chr(int(a[an]))
  1536.                                 else:
  1537.                                     extst[-int(d[dn])] = a[an]
  1538.                             else:
  1539.                                 if len(ex1tst)<=int(fabs(d[dn])):
  1540.                                     exec("ex1tst.append(0);"*int(fabs(int(d[dn]))-len(ex1tst)+1))
  1541.                                 if d[dn]>=0:
  1542.                                     if ex1tst[int(d[dn])]!=0: ex1tst[int(d[dn])]+=chr(int(a[an]))
  1543.                                     else: ex1tst[int(d[dn])]=chr(int(a[an]))
  1544.                                 else:
  1545.                                     ex1tst[-int(d[dn])] = a[an]
  1546.                         elif code[f]=="e":
  1547.                             if not globool:
  1548.                                 if len(extst)<=int(d[dn]):
  1549.                                     exec("extst.append(0);"*(int(d[dn])-len(extst)+1))
  1550.                                 extst[int(d[dn])]=boolcust(a[an])
  1551.                             else:
  1552.                                 if len(ex1tst)<=int(d[dn]):
  1553.                                     exec("ex1tst.append(0);"*(int(d[dn])-len(ex1tst)+1))
  1554.                                 ex1tst[int(d[dn])]=boolcust(a[an])
  1555.                         elif code[f]=="E":
  1556.                             if not globool:
  1557.                                 if len(extst)<=int(a[an]):
  1558.                                     exec("extst.append(0);"*(int(a[an])-len(extst)+1))
  1559.                                 extst[int(a[an])]=boolcust(d[dn])
  1560.                             else:
  1561.                                 if len(ex1tst)<=int(a[an]):
  1562.                                     exec("ex1tst.append(0);"*(int(a[an])-len(ex1tst)+1))
  1563.                                 ex1tst[int(a[an])]=boolcust(d[dn])
  1564.                         elif code[f]=="q":
  1565.                             a[an]=inputype(input("?> "))
  1566.                         elif code[f]=="Q":
  1567.                             if not globool:
  1568.                                 if len(extst)<=int(a[an]):
  1569.                                     exec("extst.append(0);"*(int(a[an])-len(extst)+1))
  1570.                                 try: extst[int(a[an])]=str(input(extst[int(d[dn])]))
  1571.                                 except TypeError: extst[int(a[an])]=str(input())
  1572.                             else:
  1573.                                 if len(ex1tst)<=int(a[an]):
  1574.                                     exec("ex1tst.append(0);"*(int(a[an])-len(ex1tst)+1))
  1575.                                 try: ex1tst[int(a[an])]=str(input(ex1tst[int(d[dn])]))
  1576.                                 except TypeError: ex1tst[int(a[an])]=str(input())
  1577.                         elif code[f]=="l":
  1578.                             if not globool:
  1579.                                 if len(extst)<=int(d[dn]):
  1580.                                     exec("extst.append(0);"*(int(d[dn])-len(extst)+1))
  1581.                                 a[an]=converter(extst[int(d[dn])])
  1582.                             else:
  1583.                                 if len(ex1tst)<=int(d[dn]):
  1584.                                     exec("ex1tst.append(0);"*(int(d[dn])-len(ex1tst)+1))
  1585.                                 an[an]=converter(ex1tst[int(d[dn])])
  1586.                         elif code[f]=="w":
  1587.                             if not globool:
  1588.                                 if a[an]>=0:
  1589.                                     filemaker(extst[int(a[an])],extst[int(d[dn])])
  1590.                                 else:
  1591.                                     filemaker(chr(int(a[an])),extst[int(d[dn])])
  1592.                             else:
  1593.                                 if a[an]>=0:
  1594.                                     filemaker(ex1tst[int(a[an])],ex1tst[int(d[dn])])
  1595.                                 else:
  1596.                                     filemaker(chr(int(a[an])),ex1tst[int(d[dn])])
  1597.                         elif code[f]=="W":
  1598.                             if not globool:
  1599.                                 if a[an]>=0:
  1600.                                     fileapp(extst[int(a[an])],extst[int(d[dn])])
  1601.                                 else:
  1602.                                     fileapp(chr(int(a[an])),extst[int(d[dn])])
  1603.                             else:
  1604.                                 if a[an]>=0:
  1605.                                     fileapp(ex1tst[int(a[an])],ex1tst[int(d[dn])])
  1606.                                 else:
  1607.                                     fileapp(chr(int(a[an])),ex1tst[int(d[dn])])
  1608.                         elif code[f]=="y":
  1609.                             if not globool:
  1610.                                 extst[int(a[an])]=filereader(extst[int(d[dn])])
  1611.                             else:
  1612.                                 ex1tst[int(a[an])]=filereader(ex1tst[int(d[dn])])
  1613.                         elif code[f]=="Y":
  1614.                             if not globool:
  1615.                                 extst[int(a[an])]+=filereader(extst[int(d[dn])])
  1616.                             else:
  1617.                                 ex1tst[int(a[an])]+=filereader(ex1tst[int(d[dn])])
  1618.                         elif code[f]=="#" or code[f]=="L":
  1619.                             if not globool:
  1620.                                 try: a[an]=float(ord(extst[int(a[an])][int(d[dn])]))
  1621.                                 except IndexError: a[an]=-1.0
  1622.                             else:
  1623.                                 try: a[an]=float(ord(ex1tst[int(a[an])][int(d[dn])]))
  1624.                                 except IndexError: a[an]=-1.0
  1625.                         elif code[f]=="№" or code[f]=="$":
  1626.                             if not globool: a[an]=float(findnumber(extst[int(a[an])],d[dn]))
  1627.                             else: a[an]=float(findnumber(ex1tst[int(a[an])],d[dn]))
  1628.                         elif code[f]=="=":
  1629.                             if a[an]==d[dn]:
  1630.                                 ifcount.append(findnew(code,f))
  1631.                             else:
  1632.                                 f = findnew2(code,f)
  1633.                         elif code[f]=="<":
  1634.                             if a[an]<d[dn]:
  1635.                                 ifcount.append(findnew(code,f))
  1636.                             else:
  1637.                                 f = findnew2(code,f)
  1638.                         elif code[f]=="!":
  1639.                             if a[an]!=d[dn]:
  1640.                                 ifcount.append(findnew(code,f))
  1641.                             else:
  1642.                                 f = findnew2(code,f)
  1643.                         elif code[f]=="{":
  1644.                             if a[an]<=d[dn]:
  1645.                                 ifcount.append(findnew(code,f))
  1646.                             else:
  1647.                                 f = findnew2(code,f)
  1648.                         elif code[f]=="[":
  1649.                             if not globool:
  1650.                                 if extst[int(a[an])]:
  1651.                                     ifcount.append(findnew(code,f))
  1652.                                 else:
  1653.                                     f = findnew2(code,f)
  1654.                             else:
  1655.                                 if ex1tst[int(a[an])]:
  1656.                                     ifcount.append(findnew(code,f))
  1657.                                 else:
  1658.                                     f = findnew2(code,f)
  1659.                         elif code[f]=="]":
  1660.                             if not globool:
  1661.                                 if not extst[int(a[an])]:
  1662.                                     ifcount.append(findnew(code,f))
  1663.                                 else:
  1664.                                     f = findnew2(code,f)
  1665.                             else:
  1666.                                 if not ex1tst[int(a[an])]:
  1667.                                     ifcount.append(findnew(code,f))
  1668.                                 else:
  1669.                                     f = findnew2(code,f)
  1670.                         elif code[f]==".":
  1671.                             ifcount.append(findnew(code,f))
  1672.                         elif code[f]==">":
  1673.                             if len(ifcount)!=0:
  1674.                                 if ifchecker(code,f): f = ifcount.pop()
  1675.                         elif code[f]==":":
  1676.                             if gotopst.count(int(a[an]))!=0: f+=1;continue
  1677.                             if gotost.count(int(a[an]))!=0: gotost.pop(gotost.index(int(a[an]))+1);gotost.pop(gotost.index(int(a[an])))
  1678.                             gotost.append(int(a[an]))
  1679.                             gotost.append(str(f))
  1680.                         elif code[f]==";":
  1681.                             if gotopst.count(int(a[an]))!=0 or gotopst.count(int(f))!=0 or gotost.count(int(a[an]))!=0:
  1682.                                 pass
  1683.                             else:
  1684.                                 gotopst.append(int(a[an]))
  1685.                                 gotopst.append(str(f))
  1686.                         elif code[f]=="j":
  1687.                             if gotost.count(int(a[an]))!=0:
  1688.                                 exec('ifcount.pop();'*countnums(code[int(gotost[gotost.index(int(a[an]))+1])+1:f]))
  1689.                                 f = int(gotost[gotost.index(int(a[an]))+1])
  1690.                             else:
  1691.                                 try: f = exec('ifcount.pop();'*countnums(code[int(gotopst[gotopst.index(int(a[an]))+1])+1:f]))
  1692.                                 except ValueError: raise GOTOPOINT_ERR("No such goto point "+'"'+str(int(a[an]))+'". '+errorprint(code,f))
  1693.                                 f = int(gotopst[gotopst.index(int(a[an]))+1])
  1694.                         elif code[f]=="J":
  1695.                             if not globool:
  1696.                                 if len(extst)<=int(a[an]):
  1697.                                     exec("extst.append(0);"*(int(a[an])-len(extst)+1))
  1698.                                 if a[an]>=0:
  1699.                                     if gotost.count(a[an])<1:
  1700.                                         extst[int(d[dn])] = code[int(gotopst[gotopst.index(int(a[an]))+1]):]
  1701.                                     else:
  1702.                                         extst[int(d[dn])] = code[int(gotost[gotost.index(int(a[an]))+1]):]
  1703.                                 else:
  1704.                                     if gotost.count(a[an])<1:
  1705.                                         extst[-int(d[dn])] = code[int(gotopst[gotopst.index(int(a[an]))+1])+1:]
  1706.                                     else:
  1707.                                         extst[-int(d[dn])] = code[int(gotost[gotost.index(int(a[an]))+1])+1:]
  1708.                             else:
  1709.                                 if len(ex1tst)<=int(a[an]):
  1710.                                     exec("ex1tst.append(0);"*(int(a[an])-len(ex1tst)+1))
  1711.                                 if a[an]>=0:
  1712.                                     if gotost.count(a[an])<1:
  1713.                                         extst[int(d[dn])] = code[int(gotopst[gotopst.index(int(a[an]))+1]):]
  1714.                                     else:
  1715.                                         ex1tst[int(d[dn])] = code[int(gotost[gotost.index(int(a[an]))+1]):]
  1716.                                 else:
  1717.                                     if gotost.count(a[an])<1:
  1718.                                         ex1tst[-int(d[dn])] = code[int(gotopst[gotopst.index(int(a[an]))+1])+1:]
  1719.                                     else:
  1720.                                         ex1tst[-int(d[dn])] = code[int(gotost[gotost.index(int(a[an]))+1])+1:]
  1721.                         elif code[f]=="/":####COMMENT
  1722.                             if code.find("/",f+1)==-1:
  1723.                                 if code.find("\n",f+1)==-1: f = len(code)-1
  1724.                                 else: f = f = code.find("\n",f+1)
  1725.                             elif code.find("\n",f+1)!=-1 and code.find("/",f+1)>code.find("\n",f+1):
  1726.                                 f = code.find("\n",f+1)
  1727.                             else:
  1728.                                 f = code.find("/",f+1)
  1729.                         f+=1
  1730.                         if f==len(code) and len(codest)!=0:
  1731.                             f = codest.pop()
  1732.                             code = codest.pop()
  1733.                     if outbool: print("",end=None);outbool=False
  1734.                     f=0
  1735.                     code=""
  1736.             print("═"*29+"╛")#WORKTAG
  1737.         else:
  1738.             continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement