Ludum Dare 31 — December 5th-8th, 2014 — Theme: Entire Game on One Screen

Back to Browse Entries

gene

by mpath - Compo Entry

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

Coolness56%
#217Innovation3.64
#498Theme3.64
#975Overall2.76
#1136Fun2.20

Comments

kraln says ...
Dec 8, 2014 @ 10:47am

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.

43iscoding says ...
Dec 8, 2014 @ 10:48am

Probably the best theme usage I encountered so far :)
Not really a game, but I like this one

Dec 8, 2014 @ 5:54pm

a very interesting take on the theme :D

raincole says ...
Dec 8, 2014 @ 5:55pm

It's hard to say if it's a game. But the theme interpretation is innovative.

Pinpickle says ...
Dec 8, 2014 @ 6:58pm

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!

davesoft says ...
Dec 8, 2014 @ 7:04pm

A delightful tech demo, but not a game. Let me know if you disagree and we can work together on something :)

Domantas says ...
Dec 8, 2014 @ 7:17pm

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

mpath says ...
Dec 8, 2014 @ 7:41pm

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!

Hammers says ...
Dec 8, 2014 @ 11:10pm

Interesting idea, and I have to give you credit for doing something really different with the theme.

alyphen says ...
Dec 8, 2014 @ 11:14pm

This is weird and quite nerdy fun.
I find it oddly enjoyable watching your little script carry out it's duty and "evolving".

AinaSG says ...
Dec 8, 2014 @ 11:16pm

Nice idea, not a "game" but this is cool and you used the theme in an original way

Nitrodeus says ...
Dec 9, 2014 @ 8:13pm

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

hazzahazzam says ...
Dec 10, 2014 @ 5:52am

5 for theme but 0 for fun. Not really a game but still cool nonetheless.

f7f5 says ...
Dec 10, 2014 @ 8:40pm

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 :)

Dec 12, 2014 @ 5:12am

This is a really cool piece of code.
I don't have anything else to say.

01rafael says ...
Dec 20, 2014 @ 9:15pm

I was compile this in my head xD
Also, I'll play in here

vegard1992 says ...
Dec 29, 2014 @ 1:49pm

genetic algorithms are cool..

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.

[cache: storing page]