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.
Downloads and Links
Ratings
![]() | Coolness | 56% |
#217 | Innovation | 3.64 |
#498 | Theme | 3.64 |
#975 | Overall | 2.76 |
#1136 | Fun | 2.20 |
Comments
Probably the best theme usage I encountered so far :)
Not really a game, but I like this one
It's hard to say if it's a game. But the theme interpretation is innovative.
Very original, I'm not entirely sure what's going on but it feels intuitive enough.
Very clean source considering you've got it all in 60 lines!
A delightful tech demo, but not a game. Let me know if you disagree and we can work together on something :)
Very interesting take on the theme, however this is not really a game. But I still spent unreasonable amount of time watching strings transform :D
Thanks to everyone that gave this a rating. I see a lot of you disagree on this being a "game". A game, to me, is an activity (or software) intended to entertain. This software was intended to both entertain and educate. I hope some aspiring game devs can learn from this code. Again, thank you!
Interesting idea, and I have to give you credit for doing something really different with the theme.
This is weird and quite nerdy fun.
I find it oddly enjoyable watching your little script carry out it's duty and "evolving".
Nice idea, not a "game" but this is cool and you used the theme in an original way
Wow, really interesting ;)
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
5 for theme but 0 for fun. Not really a game but still cool nonetheless.
I'll rank you high on the theme category. It's always good to find these out of the box approaches among all the normal entries. But this was clearly more fun to the programmer than it is to the player :)
This is a really cool piece of code.
I don't have anything else to say.
You must sign in to comment.
TEAMS: Teams entering the Jam should pick a single representative to submit your game, or create a team specific account you can share. We currently do not support Team Voting, but sharing an account and together playing and rating games is acceptable.
NOT LOGGED IN?: If you get a message about not being logged in, even though you are, it’s because your web browser cached the non-logged in page. You can fix this by either refreshing your cache or clearing your cache. CTRL+F5 in many browsers. Chrome is a bit more work. Press F12 to enable Developer Mode, then you can right click on the refresh button and select “Empty Cache and Hard Reload”. This option is unavailable if you are not in Developer Mode.
PORTS: Ports to other platforms can be done after the deadline. That said, the sooner you finish your port, the sooner people can play your game, improving your chances of placing in the final results. For best results, provide a Web version of your game, or a Windows version with no dependencies. Also be sure to rate about 20 games to improve your visibility.
MY GAME DOESN’T SHOW UP: If you can’t find your game, it’s usually because the URL to your downloads are missing ‘http://‘. Fix your URLs (http://mysite.com/mygame.zip) and you will show up. Alternatively, if you just posted it, wait a minute. The cache may not have refreshed yet.
MY GAME CRASHES, IS UNBEATABLE, OR I MADE A TYPO: We allow you to fix crash or win condition bugs after the deadline (in a sense, like “porting” to support more players). We also allow “typo” bugs. I.e. A true that should have been a false, a word that should have been a different word, very tiny changes that you would have caught if you had more sleep. We leave this open to interpretation, but generally speaking your game should be identical to the game you submitted. No new features, just things you messed up last minute. Typos.
If I run python in "screen", then it definitely meets the theme. Is it a game? Maybe, in the same way that Conway's life is a game.