gene by mpath
Gene is a genetic algorithm in 60 lines of (non-PEP8) Python 2.6+ code, with minimal imports.
60 lines of python should fit on ONE SCREEN!
This algorithm is *NOT* just making random guesses. It starts randomly, and there is randomness in it, but the principle is much more complex. See http://en.wikipedia.org/wiki/Genetic_algorithm#The_building_block_hypothesis
To play, you will need to:
1. Install Python. See python.org
2. Clone the source code with git or save this somewhere: https://github.com/mpath/gene/blob/master/gene.py
3. Run gene at a command prompt, like so: python path/to/gene/gene.py
4. You will be prompted for a string to "strive towards". You may use upper and lowercase letters and spaces, but not punctuation or numbers. Type it out (it can be as long as you'd like) and hit ENTER.
5. The genetic algorithm will run and update after every generation. At the end you will see some stats. Enjoy the show!
HINT: If it's taking too long to complete generations, try a shorter string.
60 lines of python should fit on ONE SCREEN!
This algorithm is *NOT* just making random guesses. It starts randomly, and there is randomness in it, but the principle is much more complex. See http://en.wikipedia.org/wiki/Genetic_algorithm#The_building_block_hypothesis
To play, you will need to:
1. Install Python. See python.org
2. Clone the source code with git or save this somewhere: https://github.com/mpath/gene/blob/master/gene.py
3. Run gene at a command prompt, like so: python path/to/gene/gene.py
4. You will be prompted for a string to "strive towards". You may use upper and lowercase letters and spaces, but not punctuation or numbers. Type it out (it can be as long as you'd like) and hit ENTER.
5. The genetic algorithm will run and update after every generation. At the end you will see some stats. Enjoy the show!
HINT: If it's taking too long to complete generations, try a shorter string.
| Source | https://github.com/mpath/gene.git |
| Original URL | https://ludumdare.com/compo/ludum-dare-31/?action=preview&uid=26499 |
Ratings
| Coolness | 56% | 3 |
| Overall | 2.76 | 975 |
| Fun | 2.20 | 1136 |
| Innovation | 3.64 | 217 |
| Theme | 3.64 | 498 |
Not really a game, but I like this one
Very clean source considering you've got it all in 60 lines!
I find it oddly enjoyable watching your little script carry out it's duty and "evolving".
I am always facinated by genetic algorithms, as I think they are one the best tools we have if we want to create and "evolve" intelligent and maybe conscious programs one day. If chance and natural selection made us, I don't see why genetic algorithms running on a fast enough computer couldn't create beings of at least our level of complexity. But I'm going a bit off topic ;) Anyways, I agree on the fact that anything that entertains could be called a "game", and therefore I consider that gene is a game
I don't have anything else to say.
Also, I'll play in here