Java Flies

Java flies was my first Java program, as Flies 1.0 was my first C program. It works by having each fly accelerate towards it's two nearest neighbours, which are identified by comparing the distance to the present nearest neighbours with the distance to the nearest neighbours of the nearest neighbours, and randomising every so often. Java source. I'm sure it could be optimised by a more proficient java programmer than I, but it appears to be a better implementation of the algorithm than my C version. (Jeff Cragg gave me the idea for the algorithm). It's behaviour can be modified by giving it parameters to replace the default values (via HTML) , as is done for NF (the number of flies) in the html on my homepage. The other parameters are - in HTML :

<applet code=flies3d.class width=250 height=250>
<PARAM NAME=NF VALUE="9">
<PARAM NAME=MAXSPEED VALUE="7">
</applet>

PS - download flies3d.class for the class file.

Return to my homepage