Raspberry Pi, Python, Star Trek and Morecambe & Wise

I’ve now managed to get a first, very rough version of I.L.Powell’s 1979 Triton Tiny BASIC ‘Star Trek’ game to work in Python on my Raspberry Pi. Most of my effort has been spent in understanding how the original game worked – not easy, even for someone who learned to program in BASIC at about the time the original article was published.

As I wrote in an earlier post, I wanted to try to remain reasonably faithful to the way the original game worked, even to the point of preserving the original data structures and codes. I have however made a few tweaks – the most noticeable being to slow parts of the program down to try to replicate that ‘authentic’ early home computer experience! I think I’ve achieved that part of what I set out to do.

As for my other aim of producing some reasonably elegant Python … well, not yet I haven’t! My code is a hack – and a fairly nasty one too. All this exercise has convinced me of is that 20 years or so after I cut my last piece of production code I absolutely need to go back to basics (if you’ll forgive the pun) if I’m ever going to become reasonably proficient in the language.

So I think I’ll spend a little time over the next few weeks working my way through the MIT OpenCourseWare in Object-Oriented programming in Python – it seems as good a resource to try as any.

For anyone who’s really interested, this is the original Tiny BASIC version – and this is my first working attempt in Python. Shield your eyes from my attempt if you believe that code should be poetry … to be brutally honest, this code is more like Eric Morecambe playing Grieg’s Piano Concerto in the 1971 Christmas Show.

“I’m playing all the right notes—but not necessarily in the right order.”

Posts Tagged with…

Reader Comments

  1. AFL

    Also inspired by Triton’s tinybasic, I have been working for the past month on extending a C coded tiny basic interpreter by adding missing features present in the Triton. This *should* mean that this original BASIC program could run natively on the R-Pi. This exercise is left to the interested reader!

Your thoughts?