Ad
  • Custom User Avatar

    Man, I expected to see a lot of golfy solutions compared to mine, but holy shit. Ruby has way too many handy array functions for its own good. I guess I get nerd points for being the only one (I think) who did it with trig...

    Lovely kata, forgot to eat dinner because I couldn't pry myself away.

  • Custom User Avatar

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

  • Custom User Avatar

    The Ruby tests have an extra weather type - "overcast" - that isn't given in the instructions.

  • Custom User Avatar

    Not sure if you've figured it out in the meantime, but since this comment thread helped me get the right answer I figured I should return the favor:

    Where does wallpaper go?

  • Custom User Avatar

    This. Or, in keeping with the real-world problem being described:

    "l, w, and h should be positive values, but John has been to known make mistakes when writing his measurements down. Be sure to let him know that he shouldn't buy any wallpaper if you notice an error."

  • Custom User Avatar

    The Katas page would benefit, IMO, from a filter for "show only katas I haven't completed in the specified language".

    • "Katas I haven't completed" hides those that I've gone through in Lua even though I have Language set to Kotlin.

    • "All katas" shows everything available for Kotlin, but a big shiny checkmark for the ones I've done in Lua.

    Alternatively, or in addition, the "completed" checkmark might make more sense as a checkmark/aura/something overlaid on the language icon(s) that have been completed.

  • Custom User Avatar

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

  • Custom User Avatar

    The Lua version desperately needs these tests. I was at a complete loss until I found these.

  • Custom User Avatar

    Some further Googling later, and eventually having to borrow a few lines from Rosetta, I figured it out. Thanks.

    IMO "you should not have to generate a list of prime numbers" should be in the description, as the correct solution(s) are still somewhat technical anyway.

  • Custom User Avatar

    Any tips for accomplishing this in Lua? My prime algorithm (Eratosthenes) works fine, but I can barely get through the last couple of sample tests without timing out. The full suite is a complete no-go even if I have it remember the primes I've found from test to test, which seems more technical than this kata's skill level would suggest.

  • Custom User Avatar

    Error running the tests in Lua - the solution template attempts to declare a local function inside a table:

    indexcap = {}
    local function indexcap.capitalize(s,arr)
    

    Removing local fixes it.

    Also, Lua indexes from 1 by default. The sample solutions count the string positions from 0, which will probably trip a few people up. Could use a note in the description.

  • Custom User Avatar

    Issues with the test in Lua. I have it printing the array so I can check by hand, and my returned value is correct:

    89 38 32 92 6 25 38 19 13 23 74 24 25 11 91 67 79 56 83 61 85 30 12 66 43 2 12 74 82 63 | 77 91
    return 30
    

    But I'm getting expected 29.

  • Custom User Avatar

    I agree, the wording is very unclear. Professor C. would like a function that accepts numbers a, b, and c, solves the quadratic equation ax^2 + bx + c = 0, and only returns the smaller of the two roots (x1 and x2).

  • Custom User Avatar

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