Talk:BitSwitch
Jump to navigation
Jump to search
Python3 Interpreter Update
The current interpreter makes it so that the b
command doesn't require a previous 0
or 1
. It also allows non-command characters if there is a b
in the program. I tried to make a new version of the interpreter to fix this. Sorry if there are any more bugs or if I messed something up :/ (also there's probably a lot better way to code this but am dum) Tetrapyronia (talk) 06:56, 24 November 2020 (UTC)
while True: cmd = input('bitswitch > ') cond = (cmd[0] == 'b') or ('bb' in cmd) if not cond and 'b' in cmd: if ''.join(''.join(''.join(cmd.split('0')).split('1')).split('b')) == '': print(cmd) else: print('Syntax Error') elif ''.join(''.join(cmd.split('0')).split('1')) == '': for digit in cmd: print(int(not(int(digit))),end='') print('') else: print('Syntax Error')
I will create something based of it
I will try to create a small interpreter in assembler, seems like a cool way to learn assembly :P SoicBR (talk) 14:28, 28 November 2020 (UTC)