King Rat submission fails

Post Reply
jeetee
Posts: 105
Joined: Sun Jan 04, 2009 5:25 pm

King Rat submission fails

Post by jeetee »

My solution works both in the online js-version of the HVM as in the offline version (python-file). However when entering the string in the form field, a bunch of numbers are expected, and my solution is indicated as being incorrect.

The numbers to be expected vary every submission. One of the returned messages:

Code: Select all

Expected: '3903', got: '' for input '3903,3234,783,1190,1443,-305,2567,2641,3394,2624,3755,-150,3366,1200,1458,2074,2316,3681,3555,2065'
Expected: '3701', got: '' for input '2406,2943,3701,2387,3009,2800,3360,2695,3698,265,2321,2126,737,2502,337,2176,1907,1226,2502,280'
Expected: '3995', got: '' for input '233,239,2193,-214,561,1721,1621,857,3995,2939,-150,-76,3702,2585,1599,1599,1322,960,2133,27'
Expected: '3862', got: '' for input '1141,726,734,1050,-46,1065,1351,2403,747,2473,1580,59,293,1080,1255,329,507,3601,1921,3862'
Expected: '-523', got: '' for input '-1808,-1707,-2949,-1542,-2002,-1433,-3844,-883,-1525,-758,-692,-3712,-3226,-1076,-666,-523,-1085,-2323,-599,-1668'
Anyone can test if their solution is still valid?
tails
Posts: 191
Joined: Tue Jun 10, 2008 7:51 pm
Location: Tokyo

Post by tails »

Hi,

The message says your code prints nothing. Are you sure you submit a valid HVM code as a solution?
jeetee
Posts: 105
Joined: Sun Jan 04, 2009 5:25 pm

Post by jeetee »

Ah.. I missed a print-command at the end indeed.
I should make the last testruns without tracing :roll:
superhacker
Posts: 7
Joined: Fri Mar 06, 2009 11:10 am

Post by superhacker »

my code works in the Hack VM IDE, but not when i submit it.
Are there any syntax differences?
I use whitespaces in my code to make my life a bit easier, do they get stripped during submission?
User avatar
livinskull
Posts: 22
Joined: Fri Jun 26, 2009 12:01 pm
Location: /dev/null
Contact:

Post by livinskull »

my code works in the Hack VM IDE, but not when i submit it.
Same here^^
But without whitespaces...

Getting a bunch of "HVM run ERROR: operand stack underflow (PC=2, STACK_SIZE=0)"

Huh, there was indeed some 'hidden' linebreak -.-
Last edited by livinskull on Mon Jul 06, 2009 2:05 pm, edited 1 time in total.
therethinker
Posts: 144
Joined: Fri Mar 28, 2008 11:29 pm
Location: #hacker.org on Freenode

Post by therethinker »

There are no line breaks in "real" HVM, nor are there comments.
HVM programs should be 1 line.
Post Reply