Flash Flood

gfoot
Posts: 269
Joined: Wed Sep 05, 2007 11:34 pm
Location: Brighton, UK

Flash Flood

Post by gfoot »

It would be nice if errors like "failed to flood correctly" were accompanied by the source data that the algorithm failed on. Not only does it give something more direct to fix, it also lets you check that you're interpreting the source data in the right way.

I'm assuming that an out-of-cycles error would be reported differently already.
gfoot
Posts: 269
Joined: Wed Sep 05, 2007 11:34 pm
Location: Brighton, UK

Post by gfoot »

Hmm, it's now just telling me that my program text is incorrect, even when it's the same program that it previously reported had failed to fill properly. Is it possible that something is wrong with the server? I wouldn't generally expect different results for the same submission.
MerickOWA
Posts: 182
Joined: Mon Apr 07, 2008 5:54 pm
Location: HkRkoz al KuwaiT 2019 HaCkEr 101

Post by MerickOWA »

gfoot wrote:Hmm, it's now just telling me that my program text is incorrect, even when it's the same program that it previously reported had failed to fill properly. Is it possible that something is wrong with the server? I wouldn't generally expect different results for the same submission.
If you used any no-op space instructions, it could be an extra space added to the beginning/middle of your program code which throws the instruction addresses off by one.

It also depends on the tests. If the tests are randomly generated, it could be that in some tests, your program fails to fill correctly but doesn't go over the instruction limit. On other tests, your program takes too long and thus is reported as being an 'incorrect program'.
User avatar
adum
Posts: 392
Joined: Thu Apr 19, 2007 12:49 pm
Contact:

Post by adum »

for this particular challenge, there's only one test case, so giving away where it fails would be too revealing.

adum
gfoot
Posts: 269
Joined: Wed Sep 05, 2007 11:34 pm
Location: Brighton, UK

Post by gfoot »

OK. In that case I'm confused about my program not working - it's the same algorithm I used for Deluge and another related challenge, with minor changes to support different sizes, and it worked fine on differently sized grids there - plus all my test cases pass, so perhaps I've got the input format wrong.

Could you please confirm that:
* The board is 18x18, stored in the first 324 memory locations, one row at a time, and we're meant to flood-fill from memory location 0. (Maybe my Deluge algorithm was wrong, but fluked it...)
* We're meant to fill zero locations with ones, as before
* If the program hits the cycle count, the error is explicit
* What does it mean if it just says "'XXX' is incorrect", quoting my program text? It's a different error to when it just failed to fill the space.

Experimenting a little, infinite loops seem to either result in the error I saw, or the page coming back without either an error or a restatement of the problem as usual. It's odd that it's inconsistent, and it would help a great deal if it gave an explicit error message when you exceed the cycle count.
User avatar
adum
Posts: 392
Joined: Thu Apr 19, 2007 12:49 pm
Contact:

Post by adum »

let me look into this and get back to you...

but yeah, board is as you say. everything the same as the last one basically except the size.

adum
User avatar
adum
Posts: 392
Joined: Thu Apr 19, 2007 12:49 pm
Contact:

Post by adum »

to get back to your questions, the board is laid out the same as before, in the first 324 memory locations. the thing here is that Flash Flood just always says incorrect no matter what your error is. ie, cycle count being too high is the same as failing to flood, is the same as the program terminating on error.

i just reran my solution, it still works. the problem is good =)

i think the only way to code this is to first verify that your code works offline on your own memory set, where you can see how many cycles it's using and make sure it floods correctly.
gfoot
Posts: 269
Joined: Wed Sep 05, 2007 11:34 pm
Location: Brighton, UK

Post by gfoot »

OK - my program solves the new warm-up challenge without modification. I guess it just runs out of cycles on the original challenge. It would sill be nice to know how far over budget it is, somehow. Is the warm-up data comparable in complexity?

I see tails has solved Flash Flood now anyway, so it's obviously possible by mere mortals, even without feedback. :)
User avatar
adum
Posts: 392
Joined: Thu Apr 19, 2007 12:49 pm
Contact:

Post by adum »

i found my own algo ran about 10% faster on the warmup, but results may vary.
tails
Posts: 191
Joined: Tue Jun 10, 2008 7:51 pm
Location: Tokyo

Post by tails »

Hi,

Actually I made my code in July, but I was hesitating about posting it, because it exceeds the cycle limit in some cases in my local test. I was thinking my code needed more improvement.

My code solves the Warmup one in 16004 cycles. I think I can reduce the cycles more, but it will be a pain to do it, because of the size and speed tradeoff. My code has already grown up to 1311 instructions long!

EDIT: "have been" -> "was". Sorry for my poor English.
Last edited by tails on Wed Dec 03, 2008 7:07 am, edited 1 time in total.
Skeeve
Posts: 5
Joined: Sun Oct 26, 2008 7:37 am

Post by Skeeve »

How many cycles can be used on the warmup challenge? The description states 25000, but with my code I get the error "too many cycles: 19102"?
User avatar
adum
Posts: 392
Joined: Thu Apr 19, 2007 12:49 pm
Contact:

Post by adum »

ah whoops, please try again
Skeeve
Posts: 5
Joined: Sun Oct 26, 2008 7:37 am

Post by Skeeve »

Thank you, looks much better now (now it aborts after 25000 cycles - time to start optimizing the program ;-)
tog
Posts: 70
Joined: Fri Nov 14, 2008 11:23 am
Location: Germany

Post by tog »

The simple return "... is incorrect" is kind of frustrating. After some tuning, my program needs 19002 cycles to fill the Warmup-map. The solution is also correct (as I could verify with the Warmup-challenge). But still the non-Warmup Flash Flood says that my solution is simply incorrect. Is this due to some different (harder) board? And how many cycles did my program need for that board?
tog
Posts: 70
Joined: Fri Nov 14, 2008 11:23 am
Location: Germany

Post by tog »

I further reduced my program to 18403 cycles on the Warm-Up board. The non-Warmup-Version still says that its incorrect. How small has it really got to be?
Post Reply