Java
Ant Survival - Java Coursework (mark achieved 94%)
The goal of this assignment was to produce a simple 2-dimensional predator-prey simulation. The prey were ants and the predators were ant-eaters, that eat ants, both live in a nest that is a grid of cells. The program will model the behaviour of both over a period of time.
Each cell can be unoccupied or occupied by either one ant or one ant-eater. Ants and ant-eaters may move from one cell to another in only a vertical or horizontal way, no diagonal movement can occur, the nest is enclosed and neither can move off the edges of the nest. Time is simulated in time-steps of one unit, at each time-step every ant and ant-eater performs some action.
Eaten ants or starved ant-eaters (dead items) are removed from any cell that they occupy.
example of Ant moving and breeding
The Screenshots above shows the behaviour of the Ant over four time steps. It can be seen that the Ant moves down a position in Step 2 from its original position in Step 1. Then in Step 3 the Ant moves up a position. It can then be seen in Step 4 that the Ant has moved down a position and because the Ant has survived the previous three time steps without being eaten, it has bred into the adjacent up position.
example of an AntEater eating an Ant
The Screenshot above shows that in the top row of Step 1 there is an AntEater with an Ant in the adjacent left position from it. If the move conditions are correct the AntEater should move to the left and eat the Ant as can be seen in the Screenshot of Step 2.
example of the condition that an Anteater Starving
The Screenshots above show an example test of the AntEaters moving about in Steps one to three but then because there are no Ants for them to Eat, after step 3 they die of starvation and are removed for step 4.
example of AntEater Breeding

The Screenshots above show an example test of AntEaters surviving eight time steps and being able to breed into an adjacent square. As can be seen in step 9, where two AntEaters, have been able to breed.
Checkout GUI - Java Coursework (mark achieved 89%)
The goal of this assignment was to produce a GUI (graphical user interface) of a Supermarket checkout.
example of the Checkout GUI


