File tree
Expand file treeCollapse file tree1 file changed
+7
-6
lines changed Assets/Patterns/10. Bytecode/Scripts
Expand file treeCollapse file tree1 file changed
+7
-6
lines changed Original file line number | Diff line number | Diff line change |
---|
@@ -47,13 +47,14 @@ public void Interpret(int[] bytecode)
|
47 | 47 | }
|
48 | 48 | case Instruction.INST_LITERAL:
|
49 | 49 | {
|
50 |
| -//Important that this i++ is not inside bytecode[i++] or it will not jump to next i |
51 |
| -i++; |
52 |
| - |
53 |
| -int value = bytecode[i]; |
54 |
| - |
55 |
| -Push(value); |
| 50 | +////Important that this i++ is not inside bytecode[i++] or it will not jump to next i |
| 51 | +//i++; |
| 52 | +//int value = bytecode[i]; |
| 53 | +//Push(value); |
56 | 54 |
|
| 55 | +//this can be a oneliner |
| 56 | +//in this case bytecode will use i+1 bytecode element |
| 57 | +Push(bytecode[++i]); |
57 | 58 | break;
|
58 | 59 | }
|
59 | 60 | case Instruction.INST_GET_HEALTH:
|
|
You can’t perform that action at this time.
0 commit comments