Advertisement
RasterPython

Seabass Penta Interpreter v0.40

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