the (simplified) idea is : you get a 30x25 grid of blocks with random colours, and then you have a pixel running around the screen randomly mixing the r,g and b values of two adjacent colours. this happens so fast you don't see it (it actually happens 5000 times per frame, with 15ms wait between each frame). eventually one colour "wins", after an epic fight with all the other colours. it's pretty fun to watch.
Also on the right there's a visualisation of what part of the grid each colour takes up, and their r, g and b parts for logical interpretation.
you can pause by placing the mouse over that area of the window, unpause by going on another part of the window at least once.
There is a pause button now, just hover over it.
here's a screenshot
here's a newer screenshot yay pause button.
Colour Wars V1
Colour Wars V1.1
the LINUX (as in not windows and probably not mac, though feel free to try) executable (please tell me if it works with other distros than ubuntu, if you're running one)
To execute, run
Code: Select all
$ chmod +x random_colours
$ ./random_colours
http://www.mediafire.com/?7xi6ugkhidlv4g6 the source code, for whatever use you might have (don't try to compile as is, this needs its own graphics library)
feel free to use the source code as you please, however if you use a consequent amount please quote me (John Gliksberg) (I'll leave the interpretation of "consequent" to you).
I guess I could probably find a way to make this run on windows but it would be a major pain, and who cares about mac users anyway (though the executable might - probably won't - work out of the box on mac, seeing as it's *NIX and shit)
thank you.