Best treatment I ever saw on this is John Weldon's "To Be" animation. I saw it in the UK years ago and it took me ages to find out what it was called so I could look it up on-line. Varies between light-hearted entertainment and deeply disturbing nightmare fuel depending on how much you think about it.
There is a bi-annual 48 hour solo game development competition called Ludum Dare 48h that has just finished its 11th incarnation. All the entries have to supply source so it might be interesting for you to have a look though these. This time there were over 70 final entries but you do have to realise that there is a wide range of polish and completeness.
The competition itself is actually quite fun and provides a good forum for playing at game development as at doesn't take up much time and the end results are not expected to be perfectly polished, complete games.
God made machine language; all the rest is the work of man.