Computer Science

To get more than 50% on our coursework, you had to submit extensions. Here are some of my favourite ones.

Pong

Screenshot of Pong
Screenshot of Pong.

I created a Pong clone using C and SDL.

Chess AI

Screenshot of Chess
Screenshot of Chess.

I created a Chess game and Chess minimax implementation in C.

Infinite and Generic Game of Life, and more

Screenshot of Game of Life
Screenshot of Game of Life.

Features:

  • Chunk based infinite universe. Automatically expands.
  • Interactive player and universe editor using SDL.
  • Can set the Born/Survive ruleset code (from command line).
  • Can choose the number to steps to take before opening the player or outputting to stdout (from command line).
  • Has tests.

One of the areas in computer science that interests me is artificial intelligence. I’ve done some projects experimenting in this area:

ESME, a pattern matching AI similar to Eliza

ESME is a very old project which uses simple pattern matching to do things like “my name is foo bar” → “Hello foo bar”.

Chess AI

As one of my computer science projects, I created an implementation of the minimax algorithm. Unfortunately, due to time restraints, I was unable to implement optimisations such as composition tables and position hashing. This caused the Chess AI to be limited to only looked 5/6 moves ahead, any more caused minutes worth of processing time. This lack of depth caused it to make bad choices.

Hello 2015! Recently I have created an implementation of the 3D projection algorithm. It is just wireframe models. It works pretty well, except it doesn’t do frustum culling. You still see things that are behind you, but upside down.

The source code of this implementation is available under the WTFPL or CC0 licenses - you can choose which one you want to use. Use WASD to move, arrow keys to rotate, space to ascend and shift to descend.

Recently I have been looking at languages and compilation: VMs, parse trees, lexers, and interpreters. Nand to tetris is a pretty awesome guide to how the CPU executes programs - from logic gates to high level languages.

Assembler and Bytecode VM

I created an assembler and Virtual Machine to run assembly style instructions. I haven’t released it as it isn’t as complete as I want it yet.

Parse Trees and Reverse Polish Notation (RPN)

Turns a string such as “( 0 - (6) + ( 6 ^ 2 - 4 * 1 * 5 ) ^ (1 / 2) ) / ( 2 * 1)” into a binary syntax tree, and then into Reverse Polish Notation, and then executes it.

Lexical Analyser

I have also experimented with a simple Lexical Analysisor, however it’s not at a state that I’d like to release.

Rufunge

Befunge is an esoteric programming language - a language which isn’t meant for pratical use, but rather to test programming use. The language consists of a two dimensional grid of characters. Each character is an individual instruction. I was disappointed that the authors didn’t take it seriously enough, and didn’t add input and output to it. So, I created my own! I called it ‘Rufunge’. It’s not finished yet, but can currently run most Befunge programs.

Mesecode

Mesecode is a language which compiles to Lua. It’s purpose it to make definitions in Minetest easier to read.

Instead of:

minetest.register_node("default:stone", {
    description = "Stone",
    tiles = {"default_stone.png"},
    is_ground_content = true,
    groups = {cracky=3, stone=1},
    drop = 'default:cobble'
})

You can write:

mod default

node Stone
    is ground, cracky=3, stone
    drops Cobble