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.
yeah, it's called
returnary
Why do you need to make it as short as possible?
My brain needed time to interpret the statement. Indeed confusing
Thanks for noticing my do-while solution.
About the "$valid" variables maybe you are right, but I was having fun :)
This is the whole trick, to make the code as short as possible. But I agree with you, this is really very difficult to read.
True, and its more readable too.
That was the one of the tricky parts of this one!
I have just made a more concise solution ;) https://www.codewars.com/kata/reviews/57cb045535ef62f92d0000f1/groups/610d7e5b96e25100013cae0d
Right, as I said, PHP is loosely typed. In any case,
1
and0
are perfectly valid ways to represent truth.0.1 + 0.2 in javascript
... is just a representation of how float values are imprecise. It's impossible to represent all decimals in binary. It's common in every language. PHP has these too. Tryecho 0.1 + 0.2 == .3 ? "Equal" : "Not Equal";
Thanks for your comment.
Please use a spoiler flag when divulgating elements of a solution. This is visible by anyone from the Dashboard.
This comment is hidden because it contains spoiler information about the solution
0
and1
ARE boolean values. PHP makes it even more confusing because it's loosely typed. Try doing this sometime:echo true+true+true;
And that's correct since following the rules of this kata, if the window==0 bouncing never ends.