Tag Archives: Projects

Board Games Automated

This post on Boing Boing got me thinking about the time I wrote a program that played with itself. I think it was written on the mutated basic supplied with the ICL/BT Merlin Tonto that my Dad brought home one day. Or it could have been on the ZX Spectrum, can’t remember.

Anyway, I taught the computer to play Snakes and Ladders (aka Chutes and Ladders). The board was held in a one-dimensional array – no need for two dimensions, for reasons that will become clear. Certain cells in the array held markers that would cause the program to send the player forward or backward to another cell if they landed there – this represented the Snakes (sending you backward) or Ladders (sending you forward).

I the first complete version of the game, a human could play against the computer. You pressed the space bar, and the program would roll a virtual die, that is, randomly generate a number from 1 to 6. Then it would tell you what space you landed on, whether there was a snake or ladder there, and where you ended up. Then the computer would roll the die for itself, and display it’s final position. Repeat until one or both of you were at position 100. The human always went first, and it was possible to have a draw. This prevented me from having to decide who got to play first. You had to land exactly on 100. I had implemented the rule whereby if you were at space 98 for example, and you rolled a six, you would move two forward, then back four to 96.

The next stage was to get the computer to play itself (“number of players: zero“). This was easy, just do the computer turn twice. I built in a delay to the turn and position display so you could watch them play. You ran the program, the display would flicker it’s digits for a few seconds until one of the computer players would reach 100, and it would be lauded as the winner.

The final step into insanity came when I removed the display portion altogether. You ran the program, and about a second later, a winner would be announced. Of course, it looked like I was just randomly selecting a winner and displaying it, but I knew that in the guts of the computer, the subroutines were running and pieces were being moved up and down the board. I even got it to play “best of 3”, “best of 5”, and later, “best of 99” which took a couple of minutes – but every game was played through properly.

I like to think of two Little Computer People, Red and Blue, shaking a tiny die (at least 7 pixels square on a side of course – you work it out) and moving their little pieces, hoping to land on that long ladder that went all the way from 5 to 95.

Ubuntu On The EeePC, Part 3 – The Sickening

The story so far: Part 1, Part 2

Charlie Stross, a sci-fi writer of some regard, talks about installing a new Linux OS on his Asus netbook, and again I am inspired to give it another go. Where was I?

Unetbootin woulnd’t work, that was it. So just to confirm I gave it another try, installing it on my Ubuntu dektop with the Debian Package Installer, making sure to install the dependencies. This time when I ran it, it worked fine, giving me the config screen to allow me to choose my ISO file. In the background, I’d been downloading (via bittorrent) the new Easy Peasy distro, which is the new name for Ubuntu Eee.

Unetbootin tells you to make sure the USB stick you are going to use for the ISO installation is formatted as fat32. OK, I opened gparted (the Gnome Partition Editor) and had a look. A strange thing, the USB stick, an Integral 2GB blue thing, appears as two devices in Linux, mounting itself as two drives. One of them contains a single file, U(something).exe. Both drives appear to have the same amount of space available, 1.92GB. What’s going on? In gparted, I was able to unmount and format one of the drives as fat32 as required. The other I couldn’t touch.

I left it as it was, ran unetbootin, selected the Easy Peasy ISO file and the correct USB drive, and let it do it’s magic. Once it was installed on the stick, I pulled it out and plugged it into my EeePC. I switched on, pressing the f2 repeatedly to get it into the setup screen. There, I chose the boot options, making sure the USB stick was top boot priority. Then I restarted. Fingers crossed!

“Invalid system disk. Remove and press any key”. Bugger.

I suspected this was due to the two devices issue – maybe the EeePC was trying to boot the device without the ISO on it. It didn’t give me a choice. So could I remove this other device, leaving a single 2GB device, mountable as a single drive? Gparted wouldn’t allow it. Fdisk see two devices, which you can’t merge.

I bit of googling around about this issue told me that this phenomenon of two drives is a result of some software built into the stick itself called U3, which helps with some autorun issue with Windows, allowing the stick to autorun applications or something. I don’t care about all that shite, get it off my stick.

There is a bit of a fuss about U3 on the net, with the idea of a drive purchased coming with extra software that installs itself. I found that for a long time there was no way to get rid of this software, until the creators SanDisk published a tool which could remove it. But of course, this would only run on Windows or Mac, everyone else can just sod off.

No wonder the stick was so cheap, and once again teaches me not to buy anything from f**king Dixons.

This tool seems to work though, so I came to work this morning with the intention of running the tool on my work Windows PC - in between shifts, obviously, while my colleagues wait for their turn at the pail of water. I downloaded the tool, stuck the USB stick in, ran the tool, and it said “Please insert a U3 smart drive”. The ‘Next’ button was greyed out. The tool wasn’t recognising my stick. Why won’t it recognise my stick!?

Sod it. This lunchtime I’m going to go out and buy a new USB stick from somewhere. I have myriad sticks lying around, but they’re mostly freebies with 128MB or 256MB- not big enough. I’ll crack this yet. BoingBoing Gadgets has covered other compact netbook Linux distros in the last couple of days, so it’s obviously the thing to do.

ORG 3rd Birthday

The UK Open Rights Group has now been around for 3 years, and they have released their 2008 Review of Activities. It shows how busy the group has been, and also how much more they are needed.

It seems that a week doesn’t go by when a CD isn’t lost or a laptop isn’t stolen containing personal data. Surveillance, ID cards, RFID passports, all are being touted as necessary to keep us secure. But when it’s so poorly implemented, it becomes a liability, and is it really necessary?

As more and more music is bought and distributed digitally, the ORG has a part to play in ensuring that you own the music you bought, rather than just owning a license to play a file which can be revoked at will.

There are many more issues. The review describes the problems that face not just the ORG, but everyone living in the UK. Happily, the ORG is making great progress in advising, guiding, and where necessary, stopping the powers that be. The review is packed with info on work with the grassroots, the press and behind the scenes with policymakers, and it shows that ORG is now a respected digital rights advocate and also looks forward to expanding our operations in the coming years.

As one of the Founding 1000 members, I can show you these fantastic badges. I need to choose one to put in the sidebar, but in the meantime, here they all are. As you can see, I was member number 192!

Now that I live in the US, I’ve joined the Electronic Frontier Foundation, which is the US equivalent of ORG. It’s been around longer, and has more permanent staff, and it’s had some very high profile cases, including suing President Bush, the various Attorney Generals, and the NSA. I’m proud to support them both.

Moleskine / Notebook Elastic Hackery

As well as my PDA, I keep a notebook as well, so I can quickly scribble stuff down, draw little diagrams, reminders, anything. It’s quicker than the PDA, and can support more subtly shaded drawings (though I’m no artist). My girlfriend thinks this is all very pretentious, and so it is. But sod it eh?

At work, I keep an A4 daybook, with numbered (by me) pages, and drawn-in margins. These are provided by work. At home, I’m still forging my way through the selection of Moleskine notebooks I got for my birthday last year, and one of the features I like most is the elastic that keeps them closed. The work books don’t have this, so decided to add it.

Hardback notebook elastic hack

  1. Take a leather/paper punch. It has to be able to punch a clean hole in the hard cover of the book. I used a pliers-type leather punch, available from craft shops – I had one anyway, for some reason.
  2. Open the book at the back page.
  3. Punch a hole in the top right corner of the hard cover – about an inch from the top and an inch from the side.
  4. Punch another hole in the bottom right corner of the hard cover – about an inch from the bottom and an inch from the side.
  5. Take some cloth elastic – available from most craft shops, Woolworths, sewing shops, you know. Usually available in black and white. Take your pick.
  6. Thread the elastic out through the top right hole in the hard cover.
  7. Pull it over the top of the cover.
  8. Pull it down under the bottom of the cover.
  9. Pull it in through in through the bottom hole in the hard cover.
  10. Tie the two ends of elastic, so that the resulting loop will stretch over the closed notebook and hold it firmly shut.
  11. Trim excess elastic, and you’re done!

And when you’re finshed with that book, remove the elastic and reuse it. Or don’t.

Palm Tungsten E Lego Sync And Charge Cradle

I’ve had my Palm Tungsten E PDA for about 6 months now, and it’s great. I got it 2nd hand off Ebay, and it’s given me no trouble. Here’s what I do with it… (read on, it’ll be worth it!)

  • I keep all my contacts, calendar, and tasks synced with my home PC, and backed up on my work laptop. For both I use the included Palm Desktop. I don’t want to mess up my work stuff, and I don’t want Outlook on my home PC.
  • I’ve used IR to connect it to my work Nokia 6810, by using the included software. I had to select ‘Nokia 6610’ from the available phone settings to make it work, but it works fine.
  • I play a few games: GG’s Blocks, Yahdice, Dope Wars, iLarn, iRogue, kMoria.
  • For a while I used the included VersaMail to keep track of my email, but I’ve stopped now.
  • I use DiddleBug, a Note Pad replacement for everyday notes and jottings. It’s better than the built-in app because it makes it very easy to attach an alarm to the note. I tend to scribble a note in DiddleBug, then attach an alarm to remind me to transfer it to a proper to-do or calendar item.
  • I use Plucker and Sunrise to grab web newsfeeds to read later.
  • I’ve got loads of texts from Project Gutenberg and Memoware to read on the daily commute, especially H P Lovecraft and H G Wells.
  • I use VD Image Viewer to view images like the tube map, as well as Palm Photos to keep a few personal pics on board.
  • Z’Catalog, Mass Transit and FileZ are all very useful.
  • … and finally, I use the included RealOne player to play mp3 files off a 512MB SD card. I remapped the Notepad hard button to switch to the player, and the Navigator pad performs the Volume and FF/RW controls. This way I can slip it in my pocket, and reach in to play and navigate my mp3s. Great stuff. The RealOne player is pretty good, considering how atrocious their Windows player is.

But there is a problem with the TE. It doesn’t come with a charge/sync cradle, and because it doesn’t use the Palm standard Universal Connector, you can’t buy one. No-one makes a TE-compatible cradle.

Until now.

Visiting my father over Easter, and getting some boxes out of his loft to put in my loft (books we’ll never read, vinyl we have on CD, CD’s we have more than one copy of, for example Joy Division Substance, etc), I thought I’d check out the big Lego box, and see what I could make.

I got pretty far too, but pressures of time, and the realisation that my nieces and nephews play with the Lego when they visit, and may resent Uncle Matt stealing it for his own geeky uses, forced me to give up for the time being.

It gave me some ideas though, so I’ll be figuring something out. I want

  • simple ‘drop-in’ action
  • connect to Sync and Charge
  • ability to easily remove cables for travelling

Watch this space…

Psion Siena DUCT-Xtreme Skinflint Casemod

Avoiding spending money on a new PDA! Take that, consumerism! Rar! Why spend money on a new PDA when you can spend it on gaffer tape? And then on a new PDA?

There’s a lot of sites out there which describe how the owners of high-end computer systems strive to make them even faster and more powerful by overclocking, installing liquid cooling systems and the like. They also do a lot of work to make the machine more stylish, funky, rugged, or any other style of box. Not one to be outdone, I decided to try it myself. I had an old piece of hardware that worked fine, but just needed some TLC on the case to bring it up to date. The machine – a Psion Siena 512k electronic organiser. I had been given this thing by a colleague when they bought a better model in December 2000.

Him – “Do you want this? I’m replacing it.”
Me – “How much?”
Him – “Well it’s not actually worth anything, so it’s yours”
Me – “Jurassic Park!

The system worked fine, but due to some design idiocy on the part of Psion*, after a few months of use, the flimsy casing around the hinge broke. This meant the ribbon cable connecting the main keyboard to the upper half, containing the screen and the number keypad, was exposed and vulnerable.

So, I got out my trusty roll of gaffer tape and set to it. You can see the futile struggle against reality here: Gallery in new window.

* Psion no longer make PDA hardware – this comes as no surprise when you’re confronted by the Siena. However, they did come up with Symbian, which I’m told is pretty good.

UK Postage Stamp Values

I had such trouble finding out what denominations postage stamps come in that I decided to PUBLISH them, which, God knows, is more than the Royal Mail do.

So, as at the time of posting, postage stamps are available in the following denominations:

  • 1p
  • 2p
  • 4p
  • 5p
  • 8p
  • 10p
  • 20p
  • 34p
  • 38p
  • 42p
  • 47p
  • 50p
  • 68p
  • £1
  • £1.50
  • £2
  • £3
  • £5

I like to provide a service.