richpl / PyBasic

Simple interactive BASIC interpreter written in Python
GNU General Public License v3.0
170 stars 46 forks source link

Star Trek: Get PyBasic port closer to original #41

Closed brickbots closed 3 years ago

brickbots commented 3 years ago

The current version of Star Trek in this repo is a port of a port and has lost some of the elegance of the original code, particularly the clever use of on-gosub for command parsing.

Now that PyBasic is much more compatible with older dialects, it might be nice to get the PyBasic port of Star Trek closer to the original.

Either: Pull the version in the PyDos repo at https://github.com/RetiredWizard/PyDOS/blob/main/PyBasic/startrek.bas and re-implement the REM'd out on-gosubs bringing the version in this repo closer to the original

OR

Start from the original code and do a fresh port. This will be an interesting test of PyBASIC compatibility!

RetiredWizard commented 3 years ago

It looks to me like the version in your PR #40 still has the remarked out ON-GOTO statements but I do still have the original code from the 80's which I'll ZIP up and attach to this conversation. I also have a Fortran version from the same era that had a lot of cool enhancements like Romulans, with unique Romulan weapons, cloaking, the ability to destroy stars, more advanced energy systems for enemies and the enterprise to name a few that I can remember. I'll attach that as well. startrek-fortran.zip startrekbas.zip

RetiredWizard commented 3 years ago

I also dug up a compiled copy of the Fortran version. You would need some sort of DOS emulator like DOSBOX (or a real old PC :D) to run it but I'll post that as well if you're interested. Personally I'd never run an executable downloaded from a post like this but since the thing will only run in a DOS emulator, maybe it would be okay, well I know it would be okay since I compiled the code many years ago, but then you really don't know me :)..... Just let me know.

brickbots commented 3 years ago

Well, I can't vouch for the Retired portion of your username, but the Wizard part checks out. Thanks for the notes about PR40 (I only searched for GOSUB and missed those obvious blocks!) and for the original source. Ahhh... Fortran brings back memories, but I was never really good at it.

I took a glance and it's and the PyBStartrek version is still pretty close! I've re-instated those On-Goto so I'm going to close this issue.

Checking the source your sent against this version on Vintage-Basic.net http://www.vintage-basic.net/bcg/superstartrek.bas You can see it's from the same lineage. I think the function key setting code in your original source is interesting and I'd love to know what system it targeted. It seems the PyBasic version is joining a long line of slightly different ports for various systems :-)