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.
You didn't fully understand the problem
You need to return, not display to the console/screen
Thanks.
The idea isn't for the kata to be hard, it's for people to get creative. Doesn't matter what it's ranked. I wish I saw more kata like this. Very few go for making a fun game instead of a boring problem.
That's exactly what I mean: plenty of kata try to do this, and they fail miserably. No kata I've seen does this correctly, but maybe I am yet to see one :)
But as long as you are able to take care of translations with improper tests not being approved (also after the kata gets out of beta), or your idea is to make the kata easy and accept possible workarounds (however, eval being blocked suggests otherwise), then ok, the kata is good.
No just kidding, it's still the most terrible kind of a kata :)
Plenty of other katas do things like this. If you find a flaw, point it out and it'll be fixed. That's why there's a beta process.
This comment is hidden because it contains spoiler information about the solution
This kata is doomed to end up as a mess of translations with unenforceable requirements and tests full of holes created by clueless translators. Things like eval, preprocessor, escape sequences, aliases, macros, available across languages and translators not knowing about them will turn it into a task of "please, don't do this" :/
This comment is hidden because it contains spoiler information about the solution
To be honest, because I wanted to have a function that only returns ints, but I understand if someone would want to return False instead, or just leave out a return for a
None
, which is also false-y. Therefore, this requirement.I completely agree. Sorry to the user that did that before it was prohibited :/
Some user came up with pretty clever solution using
eval
. While it is really cool, I feel like it goes agains the spirit of this kata. Maybe you should prohibit using ofeval
too?Thank you very much, @hobovsky, for a very complete and clear explanation!
I also join the question why not explicitly return
False
, instead of "falsy"-value?It would look like a good practice.
"truthy" and "falsy" are not a slang, it's more of a terminology used in languages where some non-boolean values can be implicitly coerced to a logical value of
true
orfalse
.For example, in Java there's no such thing, because only
boolean
expressions can have logical value, so you cannot write, for example,if(number % 2)
, you need to explicitly writeif(number % 2 != 0)
. In many languages though some expressions yield a non-boolean value, but it can be implicitly converted to such. For example in Python, empty list, zero, or None are converted toFalse
when used as a logical value, thus they are "falsy". Non-empty list, or numbers other than 0, can be implicitly coverted toTrue
, therefore they are "truthy" values.That being said, the requirement of returnin anything as long as it's falsy is kinda poor one and looks like (much too) literal translation of some code golfing task. In Python, you have explicit
False
, so why the requirement of "return anything as long as it's falsy"?I really liked this kata, but for the first couple of minutes I was trying to figure out what
false-y
was in the description and in the test-cases.Could it be a typo?
Maybe it would be better:
P.s: I apologize if i don't understand the terminology (or slang?) i'm not from an English-speaking country :-)
Hi)
I didn't find the right button either, but my avatar changed after I linked up the github (Account settings-->Social-->Link your github)
Now my avatar from github)