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.
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.
This comment is hidden because it contains spoiler information about the solution
The Ruby tests have an extra weather type - "overcast" - that isn't given in the instructions.
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?
This. Or, in keeping with the real-world problem being described:
"
l
,w
, andh
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."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.
This comment is hidden because it contains spoiler information about the solution
The Lua version desperately needs these tests. I was at a complete loss until I found these.
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.
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.
Error running the tests in Lua - the solution template attempts to declare a local function inside a table:
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.
Issues with the test in Lua. I have it printing the array so I can check by hand, and my returned value is correct:
But I'm getting
expected 29
.I agree, the wording is very unclear. Professor C. would like a function that accepts numbers
a
,b
, andc
, solves the quadratic equationax^2 + bx + c = 0
, and only returns the smaller of the two roots (x1
andx2
).This comment is hidden because it contains spoiler information about the solution