fix action unpack
fix action unpack if new_symbol is same as direction (<.>)
This commit is contained in:
parent
eec30e12fa
commit
e6c7f036b0
@ -20,8 +20,8 @@ def from_file(filename: str):
|
||||
if not action:
|
||||
continue
|
||||
|
||||
new_symbol, direction, new_state = re.split('([<|>|.])', action)
|
||||
new_state = int(new_state) - 1
|
||||
new_symbol, direction, *new_state = action
|
||||
new_state = int(''.join(new_state)) - 1
|
||||
|
||||
movement = {
|
||||
'>': Movemement.R,
|
||||
@ -31,8 +31,6 @@ def from_file(filename: str):
|
||||
|
||||
program.set(i, symbol, Action(new_state, new_symbol, movement))
|
||||
|
||||
# program[symbol][i] = ([new_symbol, direction, new_state])
|
||||
|
||||
f.close()
|
||||
|
||||
return program
|
||||
|
Loading…
Reference in New Issue
Block a user