Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

U NIVERSITY OF THE W ITWATERSRAND , J OHANNESBURG

COMS2003: Application and Analysis of Algorithms II


A3 Laboratory 16 2012

Example Snake Agent

This week, we will do some work towards producing the snake agent required by the assignment. 1. Go to the following URL: http://www.cs.wits.ac.za/wookeyd/description.php 2. Download the example java agent and the standalone snake server. 3. Open the example java agent and build it. 4. Follow the instructions on the site to run the standalone snake program with the example agent.

Modications
1. Now modify the example snake so that it goes up if the apple is above your snake, down if the apple is below, left if the apple is to the left and right if the apple is to the right. 2. Note that you can ignore obstacles at this point. 3. Note that if youre moving downwards and the apple is above you, the server will not allow you to go up as the rest of your snake is in the way. You must handle this by going left or right rst, which will allow you to go up.

You might also like