diff --git a/Assets/Patterns/10. Bytecode/Scripts/VM.cs b/Assets/Patterns/10. Bytecode/Scripts/VM.cs index 86c28a9..303af32 100644 --- a/Assets/Patterns/10. Bytecode/Scripts/VM.cs +++ b/Assets/Patterns/10. Bytecode/Scripts/VM.cs @@ -47,13 +47,14 @@ public void Interpret(int[] bytecode) } case Instruction.INST_LITERAL: { - //Important that this i++ is not inside bytecode[i++] or it will not jump to next i - i++; - - int value = bytecode[i]; - - Push(value); + ////Important that this i++ is not inside bytecode[i++] or it will not jump to next i + //i++; + //int value = bytecode[i]; + //Push(value); + //this can be a oneliner + //in this case bytecode will use i+1 bytecode element + Push(bytecode[++i]); break; } case Instruction.INST_GET_HEALTH: