Ad
  • Default User Avatar

    Okay. So, not explaining that in the rules is fine. It's on me for not looking at the sample tests. Got it.

    It's just that the rules go out of their way to tell you the format can't have a trailing line, so I get it when doing so fails you.
    But the rules say nothing about formatting a new line IMMEDIATELY after the last digit. You have to discern that from elsewhere. That's why I thought it was an "issue". But, I know better now.

  • Default User Avatar

    When I see this as an example answer for 5,

    1 * 5 = 5
    2 * 5 = 10
    3 * 5 = 15
    4 * 5 = 20
    5 * 5 = 25
    6 * 5 = 30
    7 * 5 = 35
    8 * 5 = 40
    9 * 5 = 45
    10 * 5 = 50
    (no trailing empty line)

    and my output is this:

    1 * 5 = 5
    2 * 5 = 10
    3 * 5 = 15
    4 * 5 = 20
    5 * 5 = 25
    6 * 5 = 30
    7 * 5 = 35
    8 * 5 = 40
    9 * 5 = 45
    10 * 5 = 50
    (no trailing empty line)

    I'm going to be confused about what's "wrong" when I fail.

  • Default User Avatar

    So...what do I call it then when I'm abiding by all the rules, creating the right table, but still failing?

  • Default User Avatar

    maybe let people know the \n has to come IMMEDIATELY after the line's last digit.
    An extra/empty space between digit and \n isn't acceptable, though that's not stated in the rules.

  • Default User Avatar

    At least in JavaScript,
    having an empty space between the last digit and the \n will fail you.
    [...answer] \n
    isn't acceptable. It has to be:
    [...answer]\n

  • Default User Avatar

    Code like this is the reason I scroll through here -- code that makes me aware of new things!
    Thanks, "cheater"!

  • Default User Avatar

    Mind me asking why you prefer this to other solutions like the one-liners above?

  • Default User Avatar

    I found the instructions rather confusing, and am offering a potential revision/clarification:

    "A hero is on his way to a castle to complete his mission but the castle is surrounded by powerful dragons!
    If each dragon takes 2 bullets to be defeated, does our hero have enough ammunition?

    Return true if he has enough bullets to survive."

  • Default User Avatar

    I'm brand spanking new to coding (two weeks of self-studying) and seeing stuff like this is motivational.
    I love seeing the different ways people think and approach problems--and how SIMPLE some code can be because of it.

  • Default User Avatar

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