Page 1 of 1

King Rat and HVM problem

Posted: Mon Aug 11, 2008 7:14 pm
by ratlover32
I am having trouble with the HVM challenges because I can't figure out how to get the initial values to be included. I always get the stack underflow error. I know that my code is right, for I have tested it by embedding the numbers in the code, but I can't get my solution to work in JS, Python, or the actual challenge page. Could someone please tell me how you initialize the memory cells?

Thank you,
ratlover32

Posted: Mon Aug 11, 2008 8:46 pm
by adum
let's say your program is

Code: Select all

0<1<+p
you put the initial memory as:

Code: Select all

1,2
and the program will print 3.

does that help?

adum

Posted: Wed Aug 13, 2008 3:51 pm
by ratlover32
Thank you!
That helps a lot. I didn't realize that you had to have something in the stack to load the memory cells.
- ratlover32