computermaster1248

Emoji-gramming Interperter

Jul 22nd, 2017
1,024
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. vardata = {
  2. 9800: 0,
  3. 9801: 0,
  4. 9802: 0,
  5. 9803: 0,
  6. 9804: 0,
  7. 9805: 0,
  8. 9806: 0,
  9. 9807: 0,
  10. 9808: 0,
  11. 9809: 0,
  12. 9810: 0,
  13. 9811: 0,
  14. 128336: 0,
  15. 128337: 0,
  16. 128338: 0,
  17. 128339: 0,
  18. 128340: 0,
  19. 128341: 0,
  20. 128342: 0,
  21. 128343: 0,
  22. 128344: 0,
  23. 128345: 0,
  24. 128346: 0,
  25. 128347: 0,
  26. 128680: 0, #command counter
  27. 128148: 0, #constant
  28. 128156: 1, #constant
  29. 128149: 2, #constant
  30. 128158: 4, #constant
  31. 128150: 8, #constant
  32. 127908: 0, #I/O
  33. 128226: 0, #I/O
  34. }
  35.  
  36. constant=(128148,128156,128149,128158,128150)
  37.  
  38. class EmojiError(Exception): pass
  39.  
  40. def clean(setcmd=False):
  41.     try:
  42.         error=1
  43.         assert cmd1 in vardata
  44.         assert cmd2 in vardata
  45.         error=2
  46.         assert cmd1 not in constant
  47.         if setcmd==False:
  48.             error=4
  49.             assert cmd1 != 128226
  50.             assert cmd2 != 127908
  51.         elif setcmd==True:
  52.             error=3
  53.             assert cmd1 != 127908
  54.             assert cmd2 != 128226
  55.             error=5
  56.             assert not (cmd1 == 128226 and cmd2 == 127908)
  57.     except AssertionError:
  58.         errorlist={1:"🚫 πŸ”‘ ➑️ πŸ”² πŸ”³ ", 2:"🚫 πŸ’” πŸ’œ πŸ’• πŸ’ž πŸ’– ➑️ πŸ”³ ", 3:"⚠ 🎀 ↔️ πŸ“’",4:"🚫 🎀 πŸ“’ ➑️ πŸ˜‡ 😈 😡",5:"🚫 😊 πŸ“’ 🎀",}
  59.         print("πŸ’»  βš οΈ ➑️ 🚨  "+str(vardata[128680]))
  60.         print(errorlist[error])
  61.         print(print(chr(cmd0)+" "+chr(cmd1)+" "+chr(+cmd2)))
  62.         raise EmojiError
  63.  
  64. import linecache
  65. import os
  66. dect = os.getcwd()
  67. print('πŸ“ : '+dect)
  68. code = input("πŸ’» ➑️ ")
  69. code = dect+"/"+code
  70. print(code)
  71. while 1 == 1:
  72.     try:
  73.         vardata[128680] = vardata[128680] + 1
  74.         try:
  75.             tempcmd = linecache.getline(code, vardata[128680])
  76.         except EOFError:
  77.             break
  78.         if tempcmd == "":
  79.             break
  80.         if len(tempcmd) >= 3:
  81.             cmd = tempcmd[0:3]
  82.         else:
  83.             cmd = "XXX"
  84.         cmd0 = ord(cmd[0])
  85.         cmd1 = ord(cmd[1])
  86.         cmd2 = ord(cmd[2])
  87.         if cmd0 == 128522:
  88.             clean(True)
  89.             if cmd1 == 128226:
  90.                 print(chr(vardata[cmd2]),end="",flush=True)
  91.             elif cmd2 == 127908:
  92.                 vardata[cmd1]=input("\n🎀 > ")
  93.                 if vardata[cmd1]=="":
  94.                     vardata[cmd1]=0
  95.                 else:
  96.                     vardata[cmd1]=ord(vardata[cmd1][0])
  97.             else:
  98.                 vardata[cmd1] = vardata[cmd2]
  99.         elif cmd0 == 128519:
  100.             clean()
  101.             vardata[cmd1] = vardata[cmd1]+vardata[cmd2]
  102.         elif cmd0 == 128520:
  103.             clean()
  104.             vardata[cmd1] = vardata[cmd1]-vardata[cmd2]
  105.         elif cmd0 == 128565:
  106.             clean()
  107.             if vardata[cmd1] == vardata[cmd2]:
  108.                 vardata[128680] = vardata[128680] + 1
  109.     except EmojiError:
  110.         break
  111. print("πŸ’»   πŸ”š")
  112. linecache.clearcache()
RAW Paste Data