xikka

A collection of the things I have made. Some of them useful, most of them not.


Codegrid

Thursday, 4th October 2018 ◆ Formal or vulgar record (8)

Codegrid was a game I entered into a game jam a few years ago. It's a programming game in which you write your programs in a 2d grid.

You can play it here.

Playing the game

You have 10 registers down the left-hand side, each of which can hold a number. On the right-hand side you have your program. In each cell you can place one of 13 different operations. Execution starts at the top left and follows the instructions that you place. When the execution dot leaves the screen, the program terminates. Here's an example program which copies the first register into the last register:

Codegrid Codegrid - copying the first register into the last

The operations you have at your disposal are:

There are 5 levels of increasing difficulty: Copy, Addition, Subtraction, Multiplication, Modulo. I completed the first four levels, but was unable to do the last myself; I just put it in because I think it's good practice to assume other people will be better at your game than you are. I wasn't even sure if it was possible, but I was over the moon when someone came up with a solution! Admittedly, I have absolutely no idea how it works.

I found it quite fun to try and build programs with the limited space available. In some ways, playing this game was a bit like making the game...

Making the game

The game is written in Chip-8, an assembly-style language used by consoles of old. I've never used a language like it before, but it was such good fun. The entire program has to fit in 3.5kB – that includes sprites, data and instructions. You have 16 registers to use (and an extra memory index register). Writing all the game code with these restrictions is really fun.

You can write over your own program if needed. Usually this will be for images or variables, but the door is open for self-modifying code too.

I recommend having a play around in Octo, an online Chip-8 intepreter. It's super fun!

Comments

There are no comments yet.