Ad
  • Custom User Avatar

    You didn't fully understand the problem

    You need to return, not display to the console/screen

  • Custom User Avatar

    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.

  • Custom User Avatar

    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 :)

  • Custom User Avatar

    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.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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" :/

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    I completely agree. Sorry to the user that did that before it was prohibited :/

  • Default User Avatar

    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?

  • Custom User Avatar

    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.

  • Custom User Avatar

    "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 or false.

    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 write if(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 to False when used as a logical value, thus they are "falsy". Non-empty list, or numbers other than 0, can be implicitly coverted to True, 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"?

  • Custom User Avatar

    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:

    Anything else such as False, 0, [], "" as input, sholud return False
    

    P.s: I apologize if i don't understand the terminology (or slang?) i'm not from an English-speaking country :-)

  • Custom User Avatar

    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)