Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
It's not only in PHP, I guess the author meant some further pattern recognition and code optimization thereby however misleading it might be at some point.
honestly I couldn't tell you
But that's not what the reference solution tests.
if (abs($gamma) <= 1e-5)
tests if acceleration is significantly different from zero, but allows negative acceleration above a certain threshold.
I should add in the description that accelaration is supposed to be positive.
This implies that a negative acceleration is ALSO set to 0.
But the reference solution checks:
if (abs($gamma) <= 1e-5)
Which is a significantly different thing.
Whoever called words with subsequent characters on the same key 'good' obviously never typed on one of these.
Typing a second character on the same key as the last meant you had to wait for the first character to time-out before you could continue typing...
Best <3
It's worth noting that this part of the description:
is not (or no longer) correct. As long as both methods follow signature compatibility rules, a class can implement two interfaces describing methods with the same name.
So the two interfaces in the exercise that overlap are actually compatible, as the methods are identical.
Issue with the PHP tests:
These incorrectly replace multiple consecutive input or output characters (
,
&.
) with just a singleputchar
/getchar
call.This is incorrect, as while reading multiple bytes from input would only store the last, it would still consume multiple bytes.
Same goes for the output: the written character would be the same each time, but it would still be written twice.
(The interpreter in the tests would print
Helo, World!
, with just a single 'l', for example).I could get my solution to pass by implementing the same error, but that is obviously not right.
Edit: Just noticed hotdonkey already reported this 9 months ago...
In the PHP version, the random tests will occasionally pop up an empty string instead of a number, combined with an error:
Stacktrace that is supplied with the code goes to the tests, not to the kata-code:
My code handles empty strings as zero, but the tests still fail, as an exception is thrown.
why?
Fixed.
right!
Fixed
The tests for the PHP version use single quotes (') to enclose the 99-bottles string, but do use '\n' in an attempt to render newlines.
However, \n is only parsed in double-quoted strings, so the song is returned as one big string containing literal \n throughout.
This obviously causes valid solutions to fail, and forces you to mimic the incorrect syntax.
Loading more items...