Updating "101 Basic Computer Games" for 2022 and beyond

On 15 June 2022, David Ahl posted a notice that he is placing all of his works in the Public Domain.

Image and this text:

“PUBLIC DOMAIN. This is a public notice that I am formally placing everything that I have written or edited into the Public Domain. That includes material that may or may not have a copyright issued to David Ahl, Creative Computing Press, Ahl Computing, Ideametrics, SBI, DEC, Military Vehicles, Ziff-Davis, or SwapMeetDave. My desire is that this material be used for educational and historical purposes and not for profit or personal gain of others. (I did this years ago, but someone wanted a public notice, so this is it.)”

2 Likes

Great news! Thanks for updating us.

1 Like

I was just looking over the basic-computer-games project for the first time in months, after being scared off by the polite but firm resistance to adding gradle build scripts for the java and kotlin applications, because the mere presence of gradle build scripts was causing some IDEs to immediately download crazy numbers of dependencies and gradle implementations, spoiling the experience for everyone.

Nevertheless, we are now left with

  • Documentation on the kotlin and java build process with dead links
  • No easy way to compile and run these jvm games

I have some solutions!

  1. Remove the dead documentation, and attempt to write some instructions for standalone running of the jvm languages. Not all games will be easy to run.

  2. Create a git submodule containing the build scripts. I can maintain the submodule separately, users using "git clone " will not see the submodule (just an empty jvmBuild directory), and only “git clone --recursive” will include the build script.

2 Likes

PR submitted for solution part 1

2 Likes

PR submitted with 14 programs implemented in MiniScript. (Under Alternate Languages of course.)

I think it’s a very good fit - a high-level scripting language with a rather BASIC-like syntax. I expect we’ll do the remaining programs too, perhaps in batches of 10-15 so as to not submit too many PRs.

Edit: I see the PR has been merged already! Thank you. :slight_smile:

2 Likes

OK, I know we’re not supposed to add features when porting these games. But I’m finding it hard to resist in 09_Battle. The whole game is based around looking at this 6x6 matrix that is printed out at the start of the game. But after a few moves, that matrix has scrolled off the top of the screen and you can no longer see it.

When the program was written, it was probably played on a teletype, so you could always just glance up at the printout at the top. Or if you’re playing on a terminal with a scrollback buffer, you could scroll up to view it on each turn (and then scroll down again to see the result of your input — a pain, but doable). But I’m in an environment with very limited scrollback. So the game is essentially unplayable.

Can I make a simple change like reprinting the matrix after each turn, or giving the user something they can enter (perhaps “?”) when they want the matrix reprinted? It’s a small new feature, but I feel like nobody is going to actually play the game through without it.

2 Likes

I think the ? command is a nice compromise! Mark in the code where it was added with a comment though. :clap:

2 Likes

Is it just me, or is blackjack.bas a buggy mess?

Not only does it frequently throw a array out-of-bounds error in line 1120, none of its totals seem to make any sense. Consider this run:

MathIsHard

I started with 9 and 2. Took a Hit, got a 5, which should total 16. Took another hit, got a 9; my total at this point should be 25, and it should be over. But the program asks me if I want to hit again. So I say Stand, and it tells me my total is 3. Where did it get 3?

Then it says the dealer, who was showing 10, had a Q concealed for a total of 9. Again this total makes no sense.

Then it draws a whole bunch of cards — this is where it frequently bombs with an error on line 1120 — and finally says its total is 19. I have no idea how it got a 19 out of a 10, a Q, and ten additional cards.

I’ve tried looking at this in creative ways, but as far as I can see it’s just complete nonsense. Yet there are no Known Bugs in the README.md, nor any comments about it in the existing ports that I could find. Anyone have any insight?

2 Likes

…one possible source of the problem: I see in line 590 Q=Q1-(Q<=21 AND Q1>21). This relies on how boolean true is represented, which I believe varied from BASIC to BASIC. Some used 1, while others used -1. That would obviously color the results. The screen shot above is from Play BASIC Computer Games in Your Browser, which represents truth as 1; my own MiniBASIC environment does the same. But I bet it was written for a BASIC that used -1!

If that’s the case, maybe we should add to the Porting Notes a list of all the line numbers relying on this behavior, so we can adjust. And if JS BASIC is meant to emulate Applesoft BASIC (which I’m pretty sure used -1), maybe we should notify Joshua Bell about it?

2 Likes

Ahh excellent find. This should be documented in the root folder porting notes!

1 Like

I just spent a few hours decoding (some but not all) variables in LEM, and the dynamics used. It actually uses polar coordinates, simulates 1/r^2 gravity, and you start out on one side of the moon and have to land on the other, so it definitely takes the curvature of the moon into account. I breaks each user provided timestep into a bunch of smaller timesteps, using Euler integration between them and assuming constant acceleration within each.

Anyway, it seems useful to document this somewhere. The only port is a Javascript version, should I add comments there? Or to the “porting notes” section?

2 Likes

Sure! If it helps all porters put it in the “porting notes” section, if it is very specific to JS put it there. Thank you so much! :bowing_man:

1 Like

(post deleted by author)

Can we do games from the second book, “More BASIC Computer Games”? Or will there be a separate repository for those?

2 Likes

I appreciate that, but let’s wait until we get the first book into a good shape!

1 Like

“Yeah yeah yeah, patience…how long will that take?”
– Ed Gruberman

2 Likes

I think it needs to be noted that 101 and BCG were different collections. They have numerous programs that are the same in both books, but there are a good number that are different or had major revisions. One example is the replacement of spcwr with Super Star Trek, another is the removal of Can-Am.

The original book was published in whatever dialect was submitted to DEC, so there are programs in PDP-8, BASIC-PLUS and even Dartmouth dialects. For BCG Ahl removed anything that had not been ported and replaced them with other programs, and ported the rest to BASIC-PLUS/MS format.

2 Likes

Fantastic and detailed clarification, thank you Maury!

1 Like