Task 352 Hurkle

Back to General discussions forum

kittyaurel     2023-09-16 10:40:46
User avatar

Hello everyone,

I tackled the Hurkle task and I ended up with a version that one can play, but the checker says

Non-zero exit code! either you've broken something, or tell admin: -1

What could be the problem? I'm thankful for every guess. :)

gardengnome     2023-09-16 11:15:22
User avatar

Your logic isn't quite working. Print out HX and HY in your code and check the messages. I tried it, the hurkle was at 3/5, I guessed 5/5 and got the reply 'go east'.

kittyaurel     2023-09-16 12:19:43
User avatar

Thank you, I will look into it. ^^

moxieman     2024-01-23 14:05:00
User avatar

I've also been seeing a different strange error with this problem. Repeatedly submitting the same code, I sometimes get a "Correct" result, and sometimes get the error Program not ended properly... perhaps you halted it?. I assume that the code must be tested against random testcases and there must be some edge case that my code can't handle that sometimes gets included in those testcases.

But looking at my code I'm really not sure what could possibly be causing this edge case error... Does somebody want to take a look at my code to double-check and make sure that it's not actually a checker-side issue? I realize my solution may be a little more 'geometric' than necessary, but it seems like the error is coming from a 'code structure' issue.

https://www.codeabbey.com/index/task_solution?task=hurkle&user=moxieman&lang=Lua

gardengnome     2024-01-23 15:48:00
User avatar

For starters: does your code really allow 5 attempts?

moxieman     2024-01-23 18:27:45
User avatar

Ah, I see. When I decreased my initial attempt counter by 1 I was getting "too many attempts" errors, but I see in retrospect that I drew the incorrect conclusion from that observation. Increasing that initial counter value by 1 was not solving the root issue.

I feel quite silly now, I must admit...

Please login and solve 5 problems to be able to post at forum