The first part i had a problem with was the random number generator, we needed our program to produce a random number every time the food reset, so that it would randomally place along the "x" axis. This is how we did it.

The second part i had problems with was the collision detection, not only did it need to know that the food had hit something, it also needed to do a number of other things. This is the code we used to get around it.

The third & final main problem i had was with the evolving part of the organism. Not only did it need to run a check to see what state the organism was, it also needed to make the hit square from above grow as the organism grew, so here's the code.
