Ad
  • Custom User Avatar

    Done in lua, this doesn't feel like an 8 kyu kata though. I feel like pattern matching is a very niche thing that not many new coders know about. Someone who is new to coding, probably won't know how to solve it.

    It isn't difficult or anything, it just feels like it relies on you knowing that one bit of information.

  • Custom User Avatar

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

  • Custom User Avatar

    Solved it. And you were right, I messed up the rounding. I misinterpreted what was asked, thanks for the help.

  • Custom User Avatar

    Care to explain what do you mean by it being a "full calculation process"? It seems to me like a simple calculation that can be presented in a formula.

    Is my calculation incorrect? if not then why does it give a different answer from the kata's answer when A = 1.

    Really hoping you'd explain, I'm trying to learn here... :p

  • Custom User Avatar

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

  • Custom User Avatar

    Brilliant exercise, great practice for loops and arrays inside arrays. While it was fairly easy and straight forward took me a couple of minutes to figure out why my code didn't return the proper result. Turns out I forgot that I had to multiply by 20 at the end... ah well :)

  • Custom User Avatar

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

  • Custom User Avatar

    Felt like great exercise for someone like me who's still learning. But the description is lacking, had to look into the the discourse to figure out what is being asked of me.

  • Custom User Avatar

    Will this work if r <= 0?
    Seems to me it won't, I could be wrong. If I am wrong here, could someone please explain why?

    like If r == 0, then r%2==0 so it returns (0, string..string)....... infinite loop