Superhack vs HVM
Superhack vs HVM
I have a question - in HVM you can jump about in your code with ? and c. Is there such a thing in Superhack? I can't work out what [,],{,} do in SuperHack, either.
There is no spoon.
As far as I'm aware you can't jump around in your code like with HVM, that could make things somewhat simpler. The closest you get to ? is s and : for conditionally changing direction but you can't directly jump to places like you can with HVM's ? c and g.
The memory is a 2D space, you start off at 0,0 when the program begins and this is where the operand stack begins too, here's how ][}{ change the stack/memory pointer:
Where "," means uninitialized, anything from 0-1024,0-128 that you haven't used ever is also uninitialized and the rest is out of bounds by default. Uninitialized memory counts as 0 but if it's read in with < or you use P but if you try to use it as a an operand to anything else you get stuff like a NaN error for arithmetic and p prints "undefined"
The memory is a 2D space, you start off at 0,0 when the program begins and this is where the operand stack begins too, here's how ][}{ change the stack/memory pointer:
- ] changes the stack pointer by <S0> * 1,0
[ changes the stack pointer by <S0> * -1,0
} changes the stack pointer by 0,1
{ changes the stack pointer by 0,-1
Code: Select all
123} 456} 3[789{ 6]111!
Code: Select all
123,,,,,,,,,
,,,456,,,111
789,,,,,,,,,
that 's how the memory would look:CodeX wrote: here's some example code and how the memory would lookCode: Select all
123} 456} 3[789{ 6]111!
Code: Select all
123,,,,,,,,, ,,,456,,,111 789,,,,,,,,,
Code: Select all
123,,,,,,,,,,,,
,,,4566,,,,,111
,,,7893,,,,,,,,