瀏覽代碼

Minor day 16 cleanup

Taddeus Kroes 7 年之前
父節點
當前提交
67812b0f8c
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      16_opcodes.py

+ 1 - 1
16_opcodes.py

@@ -50,7 +50,7 @@ while sum(map(len, opcodes)) > len(isa):
             for other, mnems in enumerate(opcodes):
                 if other != opcode:
                     mnems.discard(certain)
-opcodes = [next(iter(mnems)) for mnems in opcodes]
+opcodes = [mnems.pop() for mnems in opcodes]
 
 reg = [0, 0, 0, 0]
 for inst in program.split('\n'):