Friday, March 29, 2019

Untrusted: A superb programming game

I recently came across a wonderful programming game: Untrusted.

It is not a game you install, you just play it on your web browser. You don't need to buy it, you don't need any in-app currency. It requires some knowledge of programming.

It's a weird game. You edit code to finish a level, and very few instructions are provided.  The games require some critical thinking, and some brute-force. Some of the levels are cunning.

Do try it! It is one of the most innovative and brilliant games I have played recently.

Screenshot of the ending. It's the journey, not the destination.

Sunday, March 03, 2019

Unix from 1972... on a Raspberry Pi 3

Want to run Unix on a PDP 11, and all you have is a Raspberry Pi 2/3 handy?

Here's a Docker image I created with the first version of Unix, and SIMH (a CPU level simulator) that simulates a real PDP-11. Once you have Docker, getting it to work on Raspberry Pi is trivial:

docker run  -it youngelf/unix-72-raspi3:1.0

That should download the image, and run simh. The user is 'root', no password. Yes, this is very secure.

It is a fun system to play with. No vi (Bill Joy hadn't written it yet), but there is 'ed'. There is a C compiler which is 4k in size. The original Unix paper talks about the system.

The system is ancient: no backspace support, no command history, no control characters (Ctrl-p, Ctrl-n, Ctrl-a). Pipes on the shell have not been invented yet, though the system supports them. Redirection with > works, but the name of the file has to come immediately after the '>' character. Spaces aren't allowed between them. You have to be sure of yourself.

It is a full CPU emulator, so you can write PDP-11 assembly on this computer and assemble it.

Take a moment to think of the magic that brings you this: 
  1. The Raspberry Pi: A $35 computer.
  2. SIMH software emulating a 1970s PDP-11.
  3. Old source code for Unix, which was made available.
  4. Docker, a system to allow pre-packaged software to run with minimal effort.
  5. The Internet, that moves all these bits around.
  6. Linux, that runs on the Raspberry Pi and is available free of charge.

Many of these systems are built, powered, or influenced by Unix.

This builds on top of bahamat's git repository, which had to be recompiled for arm32.