Genetics, Postmen and Curses, Oh My

So, to get deeper into pygame and now pygcurses I have been doing some playing around with it, not making a game per say, but fun toys none the less.

I made the mistake of hanging out on the IRC (a great place full of fun people!) and iFire trolled me into a challenge of writing a genetic algorithm to solve the Traveling Sales person problem in half an hour from scratch. Needless to say I failed; it took me 38 minutes to make a working algorithm. It was so much fun, it was the first time I had ever speed run coding before.

So, whenever I do an new thing, I have to combine it with my old things, so here is TSP hopefully shortest path map, calculated with a genetic algorithm, and rendered in ncurses.

#gallery-1 { margin: auto; } #gallery-1 .gallery-item { float: left; margin-top: 10px; text-align: center; width: 33%; } #gallery-1 img { border: 2px solid #cfcfcf; } #gallery-1 .gallery-caption { margin-left: 0; } /* see gallery_shortcode() in wp-includes/media.php */ cursesTSP2 cursesTSP

Here is the source: http://pastebin.com/WjSUB4Cz (it is just a script file at this point, sorry)

Thank you Ludum Dare, for a fun time already!