This code was created for a university assignment and may not be sold nor used for any lucrative purposes. We do not take any responsibilities of the injuries it may cause. The code provided does not take into account strange variable values (like placing the player onto an obstacle or out of the world space grid. If so, you will be alerted with segmentation faults or weird results.
All credit to Martí-Joan Nogué Coll - Catsoft-Studios 2011. More information about the code can be found at
If you have any questions drop us a line by making use of the contact page.
Due to the code is in one file, compile the code as a normal c++ file
g++ main.cpp -o main.x
To execute the program, type
./main.x
If you want to change the position of the objects (player, target or obstacles) do it within the code. There is a special comment marked as ** MODIFICABLE ** from where you can tweak variables to view different results.