Department of Engineering

Some C(/C++) coding stuff:


I've been using Code::Blocks as an IDE to help me code, so all the "projects" here will be the codeblocks directories with the .cdp etc files. My .codeblock directory is available here
I learnt to program in c/c++ whilst taking an MSc in computing science in 1995, I then promptly did nothing with this knowledge until now. I was speaking with my son Ash and his best friend Alex about computer games, they insisted that making games required a large talented team. I said that if they applied themselves they could do it, but I think they underestimate themselves. These projects are my playing with C with SDL to prove them wrong, that you neither need a large team or much talent.
Programming Linux Games by John R Hall is an excellent book if you need help in starting programming with SDL.

  • Maze generator - 9th September 2012
    Surely everyone needs a perfect maze generator (A perfect maze is defined as a maze which has one and only one path from any point in the maze to any other point.) It can generate a maze on screen and output to a file walldata.txt. This file is in the following format, one line per row, each row is comma delimited with a value between 0-14 for each cell. The numbers show what walls remain, once converted to binary. the MSB first is the left wall, then down wall, then right wall with the up wall being the LSB. The blocks30x30.png file shows how this works, with the left block being 0, the right being 15..... Download code here
    Update - 14th September 2012 - Added command line parameters, ./bin/Release/mazegenerator -g x y -s 0 -f filename where -g specifies maze geometry (x*y), -s 0 turns off out put to screen (if only a file is reqd) -f specifies an output filename, if none is given no file is made.

  • Helicopters - 7th July 2012
    This is my first play with C++ and SDL, just 500 helicopters flying over a large scrolling background. Move with the arrow keys. The image was taken this February at Kennedy Space Center, Florida. Download code here.

  • Back to the main page (Home)