import random import contextlib chars="`1234567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,./~!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:\"ZXCVBNM<>? \t\n" addCMD = chars[random.randint(0, len(chars)-1)] subCMD = chars[random.randint(0, len(chars)-1)] appCMD = chars[random.randint(0, len(chars)-1)] exrCMD = chars[random.randint(0, len(chars)-1)] outCMD = chars[random.randint(0, len(chars)-1)] # 0.000000011645049% # addCMD = '+' # subCMD = '-' # appCMD = '>' # exrCMD = '<' # outCMD = '!' with open("./lotto/main.lotto") as raw: con = raw.read() with contextlib.suppress(Exception): curstring = "" curcell = 0 lines = con.split("\n") for line in lines: for chariter in range(len(line)): curchar = line[chariter] if curchar == appCMD: curstring += chr(curcell) curcell = 0 elif curchar == outCMD: print(curstring) curstring = "" with contextlib.suppress(Exception): nextchar = line[chariter+1] editor = 1 if nextchar == exrCMD: editor = 10 if curchar == addCMD: curcell += editor elif curchar == subCMD: curcell -= editor