[Community Puzzle] Asteroids

Because the negative numbers are not important for this puzzle.
int(-3.4) != math.floor(-3.4)

w and h are only two dimensions still need the third one to say the depth. in this case is the alphabetic order

Hey I’m having the same issue, I’ve sure my code satisfies all the things XorZy mentioned so I’m not sure what to change in my code.

heres my code and thanks in advance to anyone who reads this :slight_smile:

Check what your code does when, for the same row and the same column, both picture 1 and picture 2 shows a new but different asteroid :wink:

Could you plase give an example of this occurance in the format of the test cases?

I think you can easily come up with one on your own. Say (3, 3) in picture 1 contains “A” and (3, 3) in picture 2 contains “B”, and “A” and “B” are not seen in any of the rows 0 to 2.

Anyone managed to pass validator 10 in Bash?

If anyone feels like going through my code and telling my why I can’t get the last challenge, your effort would be greatly appreciated :).

Your code fails both the last test case and the last validator. You may consider checking the last test case first as you have access to both the input and expected output.

Hmm weird, my code seems to pass all but the 10th here (the armageddon). And I get really weird positions for the asteroids there…
I’ll continue to have a further look at it.

1 Like

Ha! I Had the exact same failure. Math.Floored the values instead of casting to int.

1 Like

Thanks, very helpfull for my small brain :slight_smile: !

Given:
A . . . . . | . . . . A .
. . . . . . | . . . . . .
. . . . . . | . . . . . .
. . . . . . | . . . . . .
. . . . . . | . . . . . .
. . . . . . | . . . . . .

My answer:
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
The feedback:

Failure

Found:

Expected:

…A

Help?

First photo is taken at t = 1.
Second photo is taken at t = 5.
It takes 4 time units to move by 4 distance units.
Now you have to output the photo taken at t = 6, so the asteroid should have moved 1 more distance unit when compared with second photo.

1 Like

OOF! My reading comprehension strikes again! Thank you, internet stranger!!

3 Likes

I succeeded but I suffered… :hot_face:

1 Like

Hello, I can’t seem to be able to pass validator 10. Can someone check my code to see what I have done wrong?
https://pastebin.com/Ff1vLexh
P.S. Sorry for the messy code.

The error is

Segmentation fault.
at Answer.cpp. function main () on line 92

I have made the code shorter and tried changing the conditions for that line to run, but the validator still doesn’t pass. Is there some constraint/condition I am missing? The segmentation fault couldn’t be with asteroid_names since the for loop condition is i < asteroid_names.size(), and since the size of third_picture is defined by h and w, using them as conditions, which I have done in the if statement, should stop this error. The same link above will show the changed code.

No more segmentation fault but your new code does not output a correct answer. For example, in validator 10, the first and second positions of K are quite similar to those in test 10, but your output just outputs K in its first position.