Category Archives: Geekery

Play Zork on the Raspberry Pi

If you’re looking for a bit of old-school text adventure nostalgia, you can play Zork (and many other classic text adventures) on the Raspberry Pi. Some of my earliest memories were of playing text adventure games on the clicky-clacky keyboard of the BBC Micro – in particular Twin Kingdom which featured early AI characters who would come and annoy you.

Zork was one of the original adventure games, written back in the 70s by a team who went on to form a company called Infocom, creator of numerous computer game hits of the 80s and 90s. It was an extension of the crystal cave adventure game, written for the colossal PDP10 computer.

Zork spawned numerous sequels, and arguably inspired a whole genre of ‘interactive fiction’. Today there are many interactive fiction titles you can download and play, and it’s even possible to create your own using the Inform programming language.

You can play Zork using a piece of software called Frotz – this is a ‘Z-Machine’  (the Z referring to Zork) which compiles and plays Z-code or story files. The beauty of the Z-machine approach is that the same story files can be played on almost any computer.

To get started you can download Zork 1-3 for free from the Infocom site here. Just download the zip files and extract them to a directory on your home folder.

And to play on the Raspberry Pi, enter the terminal and type:

sudo apt-get install frotz

To download Frotz, then once you’ve downloaded some inform files you can start them with the command:

frotz ZORK1.DAT

and that’s it!

Frotz is fairly self explanatory, you can save and restore game files, and use all the usual ‘look at mailbox’ ‘talk to dwarf’ ‘take key’ type commands.

Tip: if you’re using the X desktop you can navigate to the folder containing the Zork1.dat file by using the file manager and selecting open this folder in the terminal from the menu. This saves typing the cd/long/directory/structure stuff.

If you get stuck there’s a map of the Zork empire from 1979 here.

Next step is to create a Raspberry Pi text adventure game, perhaps along the lines of ‘Waiting for Pi?’

Raspberry pi XBMC media server (nearly)

One of the exciting possibilities of the Raspberry Pi is using it as a media server – potentially providing a cheap as chips way of watching online video at home (for almost the same cost as a PS3 game) or serving as a cost effective video booth for displaying content. I suspect this is one of the factors that lead to the excitement of the Raspberry Pi’s launch and the 600,000 or so pre-orders.

Raspbmc running on my lego pi
Raspbmc running on my lego pi

I’ve used XBMC before on low-end systems – it works quite well on the (now ancient) Asus EEEpc 701 and I originally installed it on an old Xbox 1 – which soon became it’s most used feature. 

I’ve recently been playing with a version of XBMC for the Pi called Raspbmc created and maintained by Sam Nazarko, an 18 year old student from London, and it’s impressive. I’ve been able to play 720p video from YouTube and Vimeo smoothly. So I thought i’d post up some instructions in case anyone wants to give it a try.

For starters I’m using a Mac as my main PC, and my Raspberry Pi is connected to a Samsung TV via a HDMI to DVI adapter. The following worked for me!

I’ve been using a Samsung 8 GB class 6 card from Amazon which seems to work fine.

First was to download the Raspbmc installer – once you get this up and running it connects to the internet and installs Raspbmc. As I’m on a Mac I modified the Raspiwrite script to include a link to the installer. If you open the python script you can either rename one of the existing links or add it as an option. You can use my edit of the Raspiwrite script here (right click and save). 

Raspiwrite is easy to use – make sure you have a blank SD card mounted on your desktop then open the terminal in your mac and type cd – then drag and drop the folder that contains your copy of Raspiwrite onto the terminal – this saves you having to write the full path (just make sure there’s a space after cd).

Then type sudo python raspiwrite.py – it’ll ask you for a password and start the script which guides you through the process. It will take a while to write to the card, so be patient. Go and have a cup of tea, or try baking some cookies.

Once it’s finished writing, you might need to add a config.txt file to the card. I had to use this to get my display working – so for reference if you’re using a Samsung SyncMaster 940MW LCD TV monitor with a HDMI to DVI adapter made by Nikkai the code you need is:

disable_overscan=1
config_hdmi_boost=4

(if you don’t have any display issues you can ignore this bit – if your display blanks after booting it’s worth checking out the threads on the config.txt file on the Raspberry Pi forums)

Then you can put the card in the Pi – either you’ll see the installer or you’ll get a command prompt. You can login to this using root and root, after which you’ll need to use shutdown -h now to shut the system down and reboot.

I think I saw this step as my Pi connects to the internet through network sharing on the ethernet on my mac – when I encounter issues with this, stopping and restarting internet sharing usually works to fix it. When I did this step I found it worked ok for me and booted into the installer – which I was able to leave to do it’s own thing, and then hey presto! Raspbmc is up and running.

It works well – some of the menu transitions are a little bit slow but video plays smoothly at 720p (which is as much as my monitor can handle). I got sound up and running by changing the settings to analog output.

Pretty HD videos to try from youtube are First Orbit which re-creates Uri Gagarin’s flight around the earth, the trailer from BBC’s Planet Earth or on Vimeo the quirky Plan of the City.

You can donate to the Raspbmc project here.

Update: there’s now a new version of the installer script which includes scripts for mac and windows – making these instructions redundant. I have got the iplayer plugin working so i’ll post up instructions on how to do that shortly.

Geeking out with a Raspberry Pi lego case

I like Lego, and I like miniature ARM based low cost PCs, so I’ve combined both with a Lego Raspberry Pi case:

Lego Raspberry Pi Case
Version 2 – slightly taller

I wanted to mount the Pi vertically to show off the intricately beautiful circuit board (and possibly to take up less space, but this thing is tiny!) and I’ve used window bricks that line up with the Pi logo. For my first attempts I tried designing a case using the lego designer – but beware, many of the bricks aren’t available from the pick-a-brick store. I’ve had to use 1×1 tiles stacked in groups of 3 to make the corners, and 2×1 tiles for the top.

This case is 4 bricks wide as the GPIO pins stick out slightly too far to fit with 2 bricks wide. Windows and arch bricks form the holes for the various plugs, with the USB and Ethernet cables emerging from the top. I’ve used the mini USB power supply from Amazon Kindle combined with a remote controlled socket for power.

The latest version has the coloured bricks at the bottom, and more clear bricks at the top to refract the light from the various power / activity indicators. It also stands a little bit taller to allow for the USB mini power plug and a grip to hold the Pi motherboard in place.

Total cost is about £30, but I do have plenty of bricks left over for other Lego projects…

I’ve now recreated the Raspberry Lego design in the Lego digital designer:

RaspberryLego case
It’s a raspberry pi case in Lego

 

I’ve coloured the bricks on the model above since they were easier to see than transparent bricks. Inside the case there’s a little c-shaped hook that the Raspberry Pi sits in. I was able to find all the bricks with the colour-scheme as used in the transparent version of the model in the pick-a-brick store.

Download the lego designer files.

If you’re building this, you need a Pi to hand to check the alignment of the ports – I have fully tested this with a Pi, but you need to build the Lego around it or it’ll get a bit fiddly.

Hacking a cheap as chips camera

CHDK – the Canon Hack Development Kit is a very neat bit of software that allows you to add lots of new and exciting features to Canon compact cameras, and is something I’ve been wanting to try out for ages.

I’ve been on the lookout for a cheap as chips digital camera for a while now, with the purpose of using it for things like underwater photography / space program / CHDK hacking. I was able to buy a nice PowerShot A480 for about £30 on ebay (they’re about £100 new on Amazon). It’s small, light, and works off AA batteries – although is a bit fussy about what type of AA battery it takes (prefers NiMh). Imagine a box brownie type camera for the noughties – cheap and super simple to use.

The A480 has a ten megapixel sensor and was launched in 2009 – although newer cameras are now in the 14 megapixel+ range a lot of this is besides the point since lens quality starts to become a limiting factor. It even has a 3.3 zoom, although with a camera like this it’s generally easier to take a few steps forward. It’s still infinitely better than the camera in my mobile phone.

CHDK is a download that sits on the SD card in the camera – the software loads off the SD card when you switch the camera on. It sits fairly neatly alongside the existing camera firmware (you can still access all your normal menus), and if you switch to an SD card without CHDK your camera reverts to it’s default state.

There’s a really easy to follow guide on the CHDK website – the only hitch I encountered was having to use a loader script since I’m using a mac – other than that everything worked smoothly.

The difference it’s made to the camera is incredible – it can shoot in RAW format, and you have complete control over aperture, exposure, ISO and a whole load of more advanced things like colour balance and flash power. There’s a huge array of settings to discover and play around with, but for me the real killer feature is the scripts.

Accessed through  CHDK you load a script from the Scripting parameters -> load script from file menus, and then run the script by hitting the shutter button whilst the <alt> text is displayed. I did a bit of experimenting with the time lapse script and created the animation below.

This is the sort of movie camera functionality that I always dreamed of when I was little – back then the only option was cine film / video, and even with that it wasn’t really in the budget of a 10 year old. It’s a blurry first attempt, but I’m quite into creating doodles.

CHDK alone is a really good reason to invest in a simple Canon compact, and although the site comes with lots of disclaimers, as I’m sure it voids warranties / Canon will come and hunt you down etc etc it’s a fairly easy way to dip your toe into the world of hardware hacking. Long may it continue!

Trying out the *new* digg

Digg isn’t the website it once was, and I must admit I generally turn to twitter now for the latest news from the rumour mills before it hits the official news sites. Despite it’s drop in traffic and influence Digg still commands a large (although male-student-dominated) audience. There’s now a ‘new digg’ with a simpler interface which harks back to the original feel of the site.

Digg screenshot
All change here

One of the interesting features is the ability to import feeds directly – so perhaps digg will become what it intended to be – a democratic way of voting for news that’s interesting. Or it might just remain “top 10 hot pictures of Christina Hendricks / 10 Star Wars characters you’d forgotten about/ top 100 1990’s video games”.

There’s a lovely infographic with a potted history of Digg available from Online Schools.

If you’d like an invite to New Digg I have a few spare – give me a shout on twitter @kimondo

My validation code is below, it activates this blog feed in Digg (although I’m not expecting the Digg effect any time soon)

<!–1f7e876ed8f9445d9c92e3a69c06179a–>

Genius christmas twitter campaign

Came across this on twitter this morning:

http://charity.further.co.uk/

By tweeting:

Tweeting this message gets 10p donated to The Children’s Society charity http://bit.ly/4PcaKP #furthercharity

your profile picture then appears on the page and the Christmas tree totalizer counts up the donations. There’s the option to top up your donation as well – although I’d be interested to find out how many tweeps actually do this. It’s always good to see twitter being used for things other than talking about Tiger Woods.

Give a tweet this Christmas
Give a tweet this Christmas

The power of a tweet…(but annoyingly I’m the only one that will ever know)

An interesting thing happened to me a few evenings ago. I was at one of the iTunes festival gigs in the roundhouse, which featured the eclectic line-up of Mumford and Sons (yawn), the Temper Trap (not bad) and Stephen Fry (yes, that Stephen Fry).

Stephen Fry was there in a warm-up capacity presumably because of his oft-voiced love of the iPhone which he uses to disseminate musings that range from being trapped in lifts, to jogging in New York. However, perhaps rather embarrasingly for Apple, Mr Fry decided to use his spot at the iTunes festival to have a go at the practices of the big music companies in aggressively pursuing illegal downloaders and filesharers.

my business – the film business, the television business, the music business – is doing the wrong thing

He spoke out against the ludicrous advert that compares downloading to pinching a handbag or stealing a car. He even fessed up to having bit-torrented a TV show – although covered himself by stating that he had already bought it on iTunes, and for some slightly unusual bandwidth reasons was unable to download it in the normal way.

Now this was all very interesting – and wildly popular with the crowd, however it seemed a little at odds to me. At the bottom of the pdf ticket I’d printed off to turn up at the gig was stated:

*You are not permitted to make audio or audiovisual recordings of the event

So when asked for a bit of feedback I tweeted the following:

listening to @stephenfry slagging off drm at itunes – where i’d get thrown out if caught filming him !

Which got slightly paraphrased when he read it on stage. Stephen Fry’s response was that everyone there was filming and photographing and tweeting – and that his speech would probably turn up on YouTube before the evening was out.

Sadly my fifteen minutes of twitter fame (quoted by the great Mr Fry – crikey!) went unnoticed to everyone but me. It even managed to get a blog on the bbc.

Maybe one day my shameless-self-publicity engine won’t let me down!

For more twitter excitement you can follow me at @kimondo

And yes, Stephen Fry did turn up on YouTube:

Stephen Fry talking at iTunes Live