Kernighan & Ritchie

Joshua noticed this post over at the Reinvigorated programmer about the best programming language book ever written and the benchmark by which any programming language book is measured. I am of course talking about Kernighan & Ritchie's "The C Programming Language ".

Posted
 

Towards the Simplest C "Hello World"

Saw this post, "Hello from a libc free world" and thought that you guys might find it interesting given that we are using C to implement emulations of simple historical hardware systems and translations of the machine code that would have run on it. The post starts with the question, why is a simple Hello World program, like the following,  still 11Kb in size: The remainder of the article delves into the intermediate assembly code generated by gcc and investigates how we can make Hello World as small as possible and actually avoid using the standar library when it is not needed. In the same vein, this tutorial on creating "really teensy ELF executables for Linux" deals with producing the smallest ELF executables on Linux and demonstrates how hand-coding the assembly in the executable is still the best way to make sure that the only code in your executable is the code that you intended to be there.
Posted
 

LittleBigLife

And you guys thought that programming this in C was tough ;) Here we have a version of Conway's Game of Life implemented in LittleBigPlanet:

Posted
 

Video Lecture: From NAND to Tetris

A video lecture that shows how to build a game-playing computer starting from first principles, e.g. hardware, and piling on the abstractions until you have a CPU, language processors, and a VM that can be used to write, compile, and run a Space Invaders game. If you are not sure whether it is worth investing the hour for the full lecture then try this 10 minute taster:

The full hour-long lecture, "From NAND to Tetris" is here:

As you begin the revision process ready for the exams you might find that taking a look at relevant video lectures like these will be a useful alternative to reading through your notes yet again.

Posted
 

Final Coursework

The requirements for coursework 5 have been posted. The core requirements for this project are more straightforward than the Manchester Baby simulator but there is scope for some very interesting extensions.
Posted
 

Manchester Baby Screencast

To match the Game of Life screencast we also have a really nice example of a Manchester Baby simulator running a nice example program:

Posted
 

Conway's Game of Life Screencast

This is the only coursework 2 screencast that I received for the gallery so it gets a front page post all to itself:

This project shows an extension to the basic requirements of the coursework, which was to develop a one dimensional CA. In this case we have a two dimensional CA that implements Conway's Game of Life rules.

Posted
 

Random Number Generators in C/C++

I found this article and thought that you guys might find it interesting because a number of you used calls to rand() in your last coursework. Basically it is comparing different implementations of pseudo random number generators in C and C++. It also gives a snippet of C++ (that you should easily be able to convert to C) that is both more random and faster than the standard version of rand().
#include <iostream>

// You need to initialize low and high to seed values.
// This would look better as a class but I’m lazy.
unsigned int low;
unsigned int high;

unsigned int GameRand()
{
    high = (high << 16) + (high >> 16);
    high += low;
    low += high;
    return high;
};

int main()
{
    high = 0xDEADBEEF;
    // usually I only have one uint32 to initialize with so I xor it
    //with a known good seed to get the second seed value
    low = high ^ 0x49616E42;
    for (int i = 0; i < 10; ++i)
    {
        std::cout << GameRand() << std::endl;
    }
}
Posted
 

Coursework #4 - Dev Project #2 Posted

The requirements for the second development coursework, "Simulating the Manchester Baby" have been posted.
Posted
 

Some Online C Resources

I found a couple of C programming language resources that I thought might come in useful for you guys. Although you all impressed me enough at the lab last week that you might not need them ;) I shall post them anyway just in case.
Posted