Ad
  • Custom User Avatar

    They're are pseudo artifical constraints, such as "use a flat map", which don't necessarily make the end result easier to reason through, especially to more beginner programmers.

  • Custom User Avatar

    Additional test cases would be helpful, and maybe a note on the difference between privelged functions and prototypical functions.

  • Custom User Avatar

    There is no test code provided, and the desired output is a bit nebulous at first. Also, there should probably be a newline required after each entry, especially to encourage good UNIX/Linux habits.

  • Custom User Avatar

    I accidentally clicked submit before I could go back and do any refactoring or take out old debugging console.log lines. Anyway, this was my first time using JavaScript and I really enjoyed learning more about JS and Genetic Algorithms as well!

  • Custom User Avatar

    Nevermind, after working on it, I figured it out -- for future reference, calling "fitness("101010")" will return a numerical value (percent) match...you can also use console.log once your solution is syntactically correct, even before you ahve a solution figured out.

  • Custom User Avatar

    As far as I know, the population array is good (it returns an appropriate value when I console.log it in a test) but I don't know how to test the output of the fitness method itself... And I'm not even sure how to debug it when it's running in the "submit" mode that provides the fitness() function.

  • Custom User Avatar

    I keep stumbling when it comes to the fitness function -- I'm calling

    for ( var m = 0; m < population.length; m++) {
        var chromosome = population[m];
        fitnesses.push(fitness(chromosome));
    }
    

    but it's only returning null -- any advice?