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.
This comment is hidden because it contains spoiler information about the solution
I'm getting
I have no idea, would you have any?
@CodeMonkey25 - thanks! I had exactly the same issue and your suggestion greatly helped me with finding the bug - maybe it was similar to yours :)
I was having this problem as well (with the first term of fibonacci being 'I7').
I finally tracked it down to not having all of my memory locations defaulting to 0.
Steepest ascent hill climb? What about simulated annealing? :P
I ran into the exact same issue but I managed to solve it. It was related to incorectly entering the [] loop.
I finally solved it after refactoring and realized I had lots of slowslowslowslow string copying and array copying going on. Now it solves a case in about 15 generations and 20 ms!
I pretty much got this done, but it keeps timing out after finding about 80% of the solution, and this is with roulette + 5% elitism. I think I could add in a "steepest-ascent hill climb" (e.g. take the most fit individual and then systematically each bit in the string from left to right, one at a time, checking the new fitness and keeping the one-bit mutant that gives the highest increase in fitness.) But I think that would be cheating since that really is more AI than GA.
Absolutely! If it works, it works; I'm not going to be upset if you didn't use the roulette algorithm. Roulette is just one method of doing it that involves a little more thought put in; looking at the top few is definitely a better way to do it.
And yeah, you can store it as an array, I just did it as a string to save space in the description.
I am stuck on fibonacci as well (similar issue, but I get 'I7' instead of '02' in place of first '1'). Tomorrow we shall be victorious!
The first word should always be capitalised e.g.
titleCase('THE WIND IN THE WILLOWS', 'The In') // should return: 'The Wind in the Willows'
This comment is hidden because it contains spoiler information about the solution
Solid chance that eval is just very slow.
02? If it's getting the string 02 then it's possible you're doing string concatenation by accident, in which case you'd want to make sure you're calling parseInt.