Star Trek game – a Python port from Tiny BASIC

A while back I mentioned that I was in the process of porting an old Computing Today Star Trek game from Tiny BASIC to Python on my Raspberry Pi. This was before I’d taken the edX Python course and learned to code properly in the language.

Frankly, although my code works, it is truly horrible stuff. And I didn’t even have the excuse of being limited to a couple of kilobytes of memory that the original was designed to fit into. I’ve just never had the time since to go back and do it better.

However, a couple of people have asked for the code, so here it is, in all of its – ahem – glory.

The original Tiny BASIC versionย (pdf format) – you’ll need this to make sense of how to play the game.

My Python portย (pdf format) – you’ll need to copy and paste this into a .py file to make it work with a Python 2.7 interpreter (obviously).

Have fun!


Posts Tagged with…

Reader Comments

        • tim

          You’re welcome, and no. I’m not prepared to attach any licence to it as it wasn’t my original idea and the python code I wrote has been vastly improved by others already. Truly “free” code!

          • ieko

            Thanks for your reply!! I was afraid there might not be a reply for such an old post. ๐Ÿ™‚

            I’m really excited that you’d like the code to be free (as in freedom), and that others have been able to build upon it (where do I find them???). In fact, that’s exactly why I suggested the GPL:

            Please forgive me if you already know this, but the GPL is the GNU General Public License. It is a software license that explicitly grants anyone who gets the code four essential software freedoms to: (1) use the software for any purpose; (2) change the software to suit your needs; (3) share the software with your friends and neighbors; (4) share the changes you make. I really like this writing on free software:

            The game isn’t your “original idea”, but your code is certainly an original work covered by copyright. Each piece of code is considered an original work/expression – this has been legally established since at least the 1970s. And under current copyright laws, no one is allowed to use your code, fork your code, or modify it unless they obtain explicit permission from you. Such permission is given through licenses. Without attaching a license to your code (and hence permission for others to use it), those who have vastly improved your code were actually infringing on your copyright, which probably isn’t what you intended! Thus, to make “Truly โ€œfreeโ€ code”, it needs a free software license, and the GPL is a great one.

            On the other hand, if you do not want any copyright associated with this code, you can also release it into the public domain (public domain is defined as any work that doesn’t have copyright) by using the Creative Commons public domain dedication:

            Sorry if this seems pedantic, but correct licensing is very important especially if you want your code to be free (as in freedom). GitHub provides easy facilities and guidance on how to apply the license, and there’s also an easy guide here:

            Thank you so much again for creating such a great piece of work and sharing it with us. Now it only needs a free software license so you can formally give everyone the permission to learn from your work and build upon it!

Your thoughts?