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.
Not a issue
Send me your machine via mail and I'll gladly keep it. Sounds like one hell of a rig!
Golfing here, not writing a production calculator in 3-4 lines of code... far from best practice, if you actually used this I would laugh at you...
Golfing here, not writing a production calculator in 3-4 lines of code... far from best practice, if you actually used this I would laugh at you...
I guess using this calculator you could simply inject random code in, so it's not a "best practice," but it's certainly effective.
Example of 12-year-old troll breaking your calculator, and its machine:
Calculator.new.evaluate(system("rm -rf *"))
My solution takes 0.4sec. on my development machine but it timeouts here. Any ideas?
This comment is hidden because it contains spoiler information about the solution
You are not supposed to convert between strings and integers at all (unless maybe for debugging purposes). If you really, really, really want to you can use the fact that the length of string is given as a parameter in
run_fitness
.Yeah, about that. I understand that it is confusing. Since we have arbitrarily large integers in Ruby we use integers instead of strings.
The description states: "What the test will do is generate a random binary string of 35 digits (a random Integer with 35 bits for Ruby)".
You are not the first person to ask about this, and probably not the last.
Could you please help and make the description more clear?
Regarding the Ruby version, how do you guys deal with the string-to-integer conversions (and the opposite)? For example
#generate
must return integers, while the tests expect strings. Do you convert all the time between calling#generate
,#mutate
and#crossover
? If so, don't you loose bits when converting, let's say, "00100" to an integer?Since the description is talking about binary strings, the tests should work with strings.
#generate
having to return numbers and not strings is contradicting with the description.Doesn't this achieve the same thig?
can anyone explain?
thx u2
Nice job m8 ;)