FightSort - An Applet for Mark E Phair

Señor Phair had an interesting idea - what would happen if multiple programs were writing to the same data space with different objectives? Would interesting patterns develop? Would anything at all happen? So, being the kind of guy I am and very easily distracted, I made something that would do exactly that. The result, in a java-enabled browser, is below.

If you can see this, then your browser doesn't support applets. Sorry about that. You can still download the source code, however. It is designed to run as an application or an applet, so you can just type java mep and everything should work.

There are 4 threads - one sorting from white to black vertically, one sorting from black to white vertically, and then two similar ones that are working horizontally. So, due to the vagaries of systems, the threads don't proceed in lockstep, and some get ahead of others. Their racing does create a few interesting patterns. Note that this is simple compared to Mark's full idea, which was to have them mess with the palette as well, and to allow them to create and destroy information.

So those are some extensions, but a few others might be to extend this to color and have 3 data arrays, one for each of red, green, and blue. Then you could have threads fighting in each dimension with each color component. That could lead to some interesting stuff. I might try that next. Note that, thanks to a bad hack, the code can be run as an applet, or as a Java application. So if you don't want to enable Java, you can download the class file and then run it on the command line by typing java mep.

Immediately after writing that paragraph, I decided to do that color idea. Here is the code, and here is the applet:

Your browser doesn't support java. You download and run it on the command line, however.

Another thing to try might be to put in totally different algorithms, instead of just Bubble Sort, as Bubble Sort totally sucks in almost every way.

Happy hacking!

Questions? Answers!