Search for the most precious substance in the universe

Who thought it was unobtainium?

Riemannian is a text-based space adventure game written in BASIC. I am not certain of its origins but it was converted to BBC BASIC by Janny Looyenga (and I think it was released as either a Beebug, or an Acorn User magazine disk).

I have just spent my afternoon converting it to run on the Raspberry Pi under RISC OS and subsequently on the PC under BBC BASIC for Windows.

In Riemannian, you control a spacecraft, which teleports randomly around a text-based Teletext universe. You have three resources that need to be managed: oxygen, fuel and provisions. Your quest requires you to mine as much of the elusive riemannian ore before your resources run out and you are unceremoniously dumped back to the BASIC prompt.

On your journey, you will encounter aliens, both friend and foe. Some will wish to sell you commodities, whilst others try to blow you away with their laser guns and robot slaves. There are also some other special encounters, but I wouldn't want to spoil your fun of encountering these yourself.

This world is very notable for the Uslian tree ant and its inhabitants' exceptional loathing of sit coms

I have covered how to convert BBC microcomputer programs to RISC OS BASIC programs in another post.

The main problem I had to overcome is the fact that, in Riemannian, much of the gameplay is time-based. You have to press the right key at just the right time to zap an alien or mine the planetoids. Upon inspection of the code, two facts became obvious. Firstly, the code was a horrible mess of spaghetti (probably indicating that it originated on a less elegant 8-bit machine to the BBC micro) and second, much of the timing revolved around how many loops the computer could perform whilst waiting for your input. As my target machine, the Raspberry Pi, is a much faster machine, I had to alter these timing loops so the original gameplay was restored. I think I have managed whilst also making the game a little more forgiving than the original.

From a time when mining was much more about guesswork (just like modern Fracking).

+1 Geek Experience Point awarded to by Janny Looyenga for the original BBC BASIC conversion.

I am going to assume that due to its age, Riemannian is currently in the public domain. So you can download a copy from my OneDrive. If you are the owner of Riemannian, and it is your sole source of income, then I am really sorry and I will remove this link as soon as you get in touch.

I've provided four versions:

  • A RISC OS BASIC file
  • A plain text file containing all the code
  • A BBC BASIC for Windows file
  • A Windows executable file (it is totally NOT a virus, but if you are in doubt run it in a sandbox such as Virtual Box rather than trusting a strange blogger on the Internet).

If you enjoyed this post, then that is it, you have reached the very bottom of the Web, but you might like some other conversions of ancient BASIC programs, such as this one, or this one, but especially this one.

That's it for today. I will be back later for more geeky stuff - stay tuned!

Stuff you can do with RISC OS for Raspberry Pi

My avid reader will know that I am a big fan of running RISC OS on Raspberry Pi.

I have already written a post answering whether you can use RISCOS as your main computer. The answer was yes (sort of). If you were not convinced then this is a post about stuff you can get your RISC OS Raspberry Pi computer to do right away.

Never forget to go to work again!
Shown above is the alarms section of the clock application and it is a surprisingly good alarm system. You can set multiple alarms, including specific dates of the year on various recurring patterns. There are two things I like about this. First, by having it in the 'run at startup' folder you get an analogue clock with seconds hand in your icon bar - as close to a 'live tile' as you will get in RISC OS Pi. Secondly, you can have multiple alarms (I am not sure what the maximum is) and alarms can seemingly be set years (months, weeks or days) into the future. There are options for 'working week', 'repeating alarms'. There is a 'Task Alarm' which allows you to boot up another RISC OS Pi app at the particular time of the day - for example, to load the radio player just in time for the shipping forecast. Simply drag the appropriate app into the alarm dialogue box. This includes your own BASIC programs as well (rather exciting, no?) Repeating alarms can be programmed to run on particular intervals, or on the first Sunday of each Month.

As you might expect, RISC OS has a calculator app, and it is as good as any you will find on your 'other' desktop machine or phone. Shown here is the programmer's calculator should you need to perform a left shift on a nibble, or whatever.

Happy New Year! What? Not another one!
As desktop calendars go, it is not as good as Window's 10 calendars with Outlook integration, but if you need to know the date of the next Friday before payday, then this will do plenty. It is also highly customizable, and I think the result looks good. Some operating systems don't even have a desktop calendar - I'm looking at you, ChromeOS!

NetRadio - highly recommended. 
My longtime reader will know that one day I hope to have a second reader on this blog. They will also know that I like to listen to a wide range of music as I sit back and relax with some knitting. The NetRadio app turns your RaspberryPi into an internet radio (oh, and before you ask, I don't record the top forty onto compact cassettes anymore, honest).

It's notepad
One of the main roles for my Raspberry Pi is to simply keep notes, records, and calculations. Between the simple but powerful StrongEd text editor (shown above) and PipeDream, RISC OS has this basic computing job covered. Pop over to the task window (F12) and you can navigate your text file library using the *BUILD <filename> and *TYPE <filename> commands. This, obviously, makes you feel more like a hacker even though you are really just writing your thank you letter to Santa. StrongEd is a little more than Notepad for RISC OS, featuring spell checker, split screen and various other features for the power user to enjoy.

Sometimes you need to know the distance to the shops in astronomical units.

Convert is my go-to app for converting various units. There are loads of units available, I'm just showing a small selection of the 'less common' ones.

Weather UK is an app for showing simple weather data for various cities in the UK.The data comes from the BBC weather feeds and clicking on the text will bring up a forecast in your browser.

And that's not it! One really awesome feature (for me at least) is that RISC OS will run most of your favourite BBC BASIC applications. I have already written a post all about this and I am currently in the process of converting various files from my BBC master 128 onto the Raspberry Pi. No doubt I shall be back really soon to write about this.

If you enjoyed reading this post, then do please share it with your friend. It would be great to have two readers! If you don't have a friend, then no worries, you might like to read about data logging on Raspberry Pi, or something random but similar.

Until next time...

Lego city cargo train

Well, I know I haven't posted in a while. Life has thrown up some interesting challenges and upheavals over the last nine months, but my new year resolution is to get this blog back up and running and make it geekier than ever.

So, in the interest of sharing something geeky for the new year, here is my most recent project, the Lego city cargo train.

Lego city cargo train under construction:

A dozen or so bags of stuff! You will need about four hours to build this set or a few friends to help.

It begins!

It began

Customary shot of Lego pieces scattered around

The beginnings of a very garish looking base. This will become the engine carriage.

The engine carriage under construction.

Almost there

Adding the 9V power supply

The almost complete engine

One of three cargo carriage sections.

More space for cargo

I love the detail on this

Lego city cargo train comes with enough track for a reasonable oval circuit, however, I've added some extra track pieces so the whole route is a little longer.

Some videos of the train in action. First sped-up:

And another one here:

I hope you enjoyed this Lego post. If so, you might like to see these other Lego posts, or this Lego Millenium Falcon, or TARDIS. Maybe you just want something completely different.

geeky things to say to Cortana

If you are like me then you love talking to technology and you are a geek. So, ahead of Star Wars day tomorrow, here are some geeky things you can say to Cortana if you get a moment.

"Give me a Star Trek Quote" - There are FOUR lights!

"Give me a Star Trek quote" - Should be KHAAAAAAAAAAAAAAAAAAAN! though, right?

"Give me a Red Dwarf quote"

"What's your favourite Star Wars Movie" - again, Cortana is wrong. There are only two good Star Wars movies.

"Tell me a Star Wars joke" - chortle
Do you really need to be told what I said?
"Give me a high five"
"May the force be with you"

If you enjoyed this post then you might want to take a long hard look at yourself and maybe get out into the countryside a bit more often. Failing that, you can amuse yourself a bit more with some Star Wars Name Generator fun, or maybe just some more posts about Cortana.

Today we celebrate three years in space

On the first of May three years ago we launched Project Poxima the world's first internet based space mission.

Project Proxima is a hypothetical, light-speed space mission to the Proxima Centauri star system. The aim is to create a teaching tool that helps explain the vastness of interstellar space (it's big, reaaally BIG!).

Today Proxima has traveled nearly 28 trillion km - that's about 70% of the total distance.

A lot has happened in the time since launch: perhaps most notably are the rise of Trump and the British referendum on Brexit. Most interestingly, however, that since launching the Project Proxima mission, scientists have discovered an earth-like planet in orbit around the Proxima Centauri system.

You can get involved in the mission by following on Twitter, or tracking the progress on the website.

You can also become an official supporter and sign up for email alerts.

Want to read more about Project Proxima?

BBC Micro versus PC at chess

If a BBC microcomputer met a Windows 10 PC for a game of chess, which machine would win?

Let's find out.

The contestants:

BBC microcomputer 32KB RAM, 2MHz 8 bit 6502 processor
Chess engine - Acornsoft Chess

Windows 10 PC 24GB RAM, 2.9GHz i7 64 bit Quad-core processor
Chess engine - Chess level 100

Chess Level 100 for Windows 10 (on the left playing black) V. Acornsoft Chess for the Beeb (on the right playing white)

I decided to start with both machines running on their lowest setting. Acornsoft Chess has ten levels of difficulty whereas Chess Level 100 has, erm... one hundred levels of play. The BBC machine was emulated using BeebEm on the Windows PC. I initially set the BBC difficulty to the highest possible, however, after waiting over ten minutes for it to make its opening move, I decided to drop the difficulty level for the sake of sanity. Both machines came to a gentleman's agreement that the Beeb would play white.

You can follow the game below, or download the PGN file to study on your own system or board.

1. Nf3 h6

Against United Nations security resolutions, the Beeb starts with the Zukertort Opening, keeping its options flexible. The PC responds with a dubious pawn defence. Maybe it doesn't know that there is a war on?

2. d3 d5
3. g3 Nc6
4. Nbd2 Bg4

Already the PC is on the offensive with bishop g4. The Beeb responds with an excellent defence from his own bishop.

5. Bg2 Qd6
6. O-O f5
7. Bh1 b5
8. Nh4 Nf6
9. Rb1 Qe6

PC has an active Queen and is attacking with its pawns. The Beeb is focussed on defence.

10. f3 b4

A superb attacking move from the Beeb threatens the black bishop, however, the PC makes the dubious pawn advance to b4. It was at this point that I realised that the PC was clearly outmatched by the Beeb. First blood went to the Beeb by capturing the neglected black bishop.

11. fxg4 Nxg4
12. Bf3 Nd4
13. Bxg4 Nxe2+

The PC ignores the bishop capture on g4 and sacrifices its knight for a pawn on e2.

14. Bxe2 Qe3+
15. Rf2 e5
16. Nxf5 Qc5
17. Bh5+ Kd8
18. Bf7 Qc6
19. h3 g5
20. b3 Rc8
21. Qf3 g4

The Beeb's white pieces are beginning to dominate the board as black makes another blunder with the g4 move.

22. hxg4 Be7
23. Qxd5+ Qxd5

The Beeb captures the pawn on d5 and forces a swap of queens. It is pretty much all over for the PC now but neither machines offered a ceasation to hostilities.

24. Bxd5 c5
25. Kf1 Rg8

A blunder from the PC puts the black rook in the firing line of the white bishop. Maybe fog of war or otherwise poor intel did not reveal the white bishop lying in wait like a sniper.

26. Bxg8 h5
27. gxh5 c4
28. dxc4 Kd7
29. Nh6 a5
30. Ke1 Rc5
31. Ke2 Rc8
32. Ke3 Bc5+
33. Ke4 Bxf2

The PC makes some good play and steals a rook at f2 with probably the only good move it made all game.

34. g4 Be1
35. Bd5 Rh8
36. Nf3 Rxh6

Another blunder from black coming up. The white knight on h6 is too much of a temptation and does not seem to realise it is covered by the white bishop on c1. The Beeb does not let it get away with this mistake.

37. Bxh6 Bf2
38. Kxe5 Kc7
39. Nd4 Bg3+
40. Ke6 Bf2
41. Bf4+ Kc8
42. Nf3 a4
43. bxa4 Bc5
44. Ng5 Bb6
45. Rxb4 Bc7

The breakthrough is complete. Black's king hides in his underground bunker and denies the reports of his generals that the enemy is massing at the gates.

46. Bb7+ Kd8
47. Nf7+ Ke8
48. Bxc7 Kf8
49. Bc6 Kg8
50. Bd5 Kf8
51. Nd6 Kg7
52. Ke5 Kh7
53. Nf5 Kh8

Moments before the end black's king has shuffled off into the corner to die.

54. Rb8+ Kh7
55. Rb5 Kh8
56. Rc5 Kh7
57. Ke4 Kh8
58. Rc6 Kh7
59. Rh6#
White wins.


So the winner of this battle was the BBC microcomputer running on the emulator. This did come as something of a surprise, but it teaches us very little. The Beeb played reasonable chess, it did not make any blunders and was both defensive and exploitative of black's errors. The PC running Chess Level 100, on the other hand, played very poor chess and was punished for it by the Beeb. It is important to note that both chess engines were playing at their very lowest settings. I am an average ability chess player and I can beat both of these programs with ease on their lowest settings. Clearly, the lowest level of Chess Level 100 is designed to be a pretty weak player.

If there is any interest in this post then I will maybe follow up with a game where both machines are playing at their very best. Important to note that the Beeb made all its moves in just over 5 minutes at this setting, yet it took over ten minutes to make a single move at the highest setting so it won't be a very quick game.

If you enjoyed watching this game, then you might want to let me know by writing something on the noticeboard or maybe you just want to read some more posts about chess