because of the inputs t1 t2 t3
in great delta A moves 4 steps and t2-t1 = 4
t3-t2 = 1 so it moves one step and stays in bounds
in out of bounds t2-t1 = 100 and t3-t2 = 100
the moves ares the sames
because of the inputs t1 t2 t3
in great delta A moves 4 steps and t2-t1 = 4
t3-t2 = 1 so it moves one step and stays in bounds
in out of bounds t2-t1 = 100 and t3-t2 = 100
the moves ares the sames
Thanks. I didnāt notice the ātā variables had valuesā¦
Hello,
Iām passing all tests from 1 to 9, but Iām stuck on Armageddon ^^ It seems Iām failing on K placement.
I found that the time ratio is 0.5 from T3Bis (imaginary linear T3, placed at 125) to T3. Considering that ratio, the initial move { x: +8, y: +7 } should become { x: +4, y: +3 (3.5 floored) }
But Iām failingā¦ So am I missing something ?
Thanks !
I think I know whatās going on.
I have designed the puzzle with the origin at the top left corner and the y axis increasing as you go down (which I falsely assumed was the implied standard coordinate system for computer graphics) whereas I think you have the origin at the bottom left corner, with the y axis increasing as you go up.
Were it not for the flooring operation the sign would not matter, but it will be problematic when you start having fractional parts like in the last test cases.
I will edit the edit the statement to make it clearer, thank you.
Ohh I see, I would have never guessed thatā¦
Thanks for the input, Iāll use top as y = 0, should be fine with that.
Hey, I passed all test cases, definitely didnāt hardcode and Iām only getting 90% when submitting. Apparently I fail at validator 8. Any help would be appreciated, as it is driving me crazy!
Validator 8 is not much different from test case 8. Maybe you can design some custom cases to test your code.
You should check your rounding method.
if the number is -0.5, should it be rounded to 0 or -1?
I dont think thats the case, my rounding method looks like this
int x3 = (int) Math.floor(x2 + (tFactor * xd));
where tFactor is the ratio of change between t3, t2 and t2, t1 (a double) and xd=x2- x1;
Okay, seems like I solved the validator 8 issue. I always had the correct result, but it seems like the system wanted me to optimize the whole (its not moving in those two picturesā¦) thing
It turns out the problem was that, given the visible test cases, one could assume asteroids are always given in consecutive order (E,F,G,Hā¦).
This was not intentional and it was, in fact, not guaranteed in the statement but it turned out that Validator 8 was, unfortunately, the only exception.
Given the nature of Test Case/Validator 8 it is possible to overcome this by simply printing the original picture if both picture 1 and 2 are the same.
However I think it is better to make it clearer so, as usual, I have edited the contribution so that the corresponding test case will also feature a pair of asteroids which are not two consecutive letters.
Ohā¦ Same here
Hi
Can an asteroid disappear if they are all moving horizontally as it happens with asteroids E and J in the test case 9?
As long as an asteroid moves out of bound (whether moving horizontally, vertically or otherwise), it will disappear in the picture.
Thank you
I thought they moved around if they got out of bounds
I have the same issue with Validator number 10 (all my test in ide pass).
So i have tried to test the round of negative number like -0.5 => -1 and itās ok.
The letter Z seems to be taken into account (last test Armagedon itās ok).
So i donāt know where i can search. I will take any ideas
What does your code do in case -1 is calculated?
Also, does the following help you?
If an asteroid position equal to -1, itās not display in the result. (Like test āOut of boundsā)
I thinked had take care to verified all about this recommandations. The ide tests do not cover all of this ?
I will try to found the issue again and fix them .
Thanks for reply.
Donāt know if it will help you, but the five inputs (first line) of the 10th validator are the same than those of the 10th test.
Nice puzzle, I understand it wrong at first because I thought that rounded to floor was meaning taking the closest value to the floor. And for me the floor was in the bottom, where Y coordonates are higher.