100 BASIC Computer Games, Ported to MiniScript
Tags: miniscript, minimicro, basic, programming
Published: 2023-10-24 17:38:18

Jeff Atwood started a [project](https://github.com/coding-horror/basic-computer-games) in 2021 to update and convert about 100 BASIC computer programs from the classic book, [BASIC Computer Games](https://en.wikipedia.org/wiki/BASIC_Computer_Games).  A team of volunteers began porting these programs to a variety of more modern computer languages.  The goal is to preserve these important artifacts of computing history, and make them accessible in modern times as living programs you can play with, hands-on.

We in the [MiniScript](https://miniscript.org) community [joined the fun](https://dev.to/joestrout/converting-100-classic-basic-games-to-miniscript-4p3g) earlier this year.  I am proud to say that that project is finished: **every BASIC computer program in the archive has been ported to MiniScript**!  You'll find our ports in the official repo in each subfolder under the [00_Alternate_Languages](https://github.com/coding-horror/basic-computer-games/tree/main/00_Alternate_Languages) folder.

But to make it even easier to try out these old classics, I've gathered them together in a [Mini Micro](https://miniscript.org/MiniMicro) virtual machine, with a handy little menu!

![screen shot of BASIC Computer Games menu](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/58c0co3vj4xw7uebqsde.png)

## How to Play the Games

Just point your desktop web browser to:

  https://joestrout.itch.io/basic-computer-games

...and you should see the menu pictured above.  Enter the number of any program on the list, and you'll see the contents of the README file for that project (which generally mirrors what appeared in the original _Creative Computing_ magazine along with the program).

![Screen shot of README info for program 83, Stock Market](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qtgz8av37pdd21z86ekt.png)

At that point, you can press **R** to run the program, or any other key to return to the main menu.

When a program completes, you should be prompted to press any key to go back to the menu.  But if something breaks, and you find yourself staring at a blinking rectangular cursor next to a square-bracket prompt character, then just type `menu` to return to the list of games.  Similarly, if you decide to bail out in the middle of a game, press **Control-C** to break out of it, and then type `menu`.

## Peeking Under the Hood

Curious what the code looks like for any of these programs?  That's great!  Run the program, and then break out of it with **Control-C**.  Then simply type `edit` to open the code editor.  Examine the code all you like — maybe even dare to change something! — and then click the round "Close & Run" button to run it again.

When done poking at the code, either let it run to the end, or use the `menu` command to go back to the menu.

## Building on These Foundations

The entertainment value of these old programs varies greatly — some are quite fun, while others, not so much.  In many cases, though, the chief obstacle to fun is not the concept or code, but the limitations of a text-based interface that was all they had available back in the day.

This presents a great opportunity for some coding fun!  You could start with the current port, and improve the UI using the [mouse and graphics support](https://miniscript.org/files/MiniMicro-CheatSheet.pdf) available in Mini Micro.

For example, take program 26, "Chomp".  This is a fun little puzzle, like the classic take-away matchsticks game but in two dimensions.  However, on every move you've got to enter your coordinates numerically; wouldn't it be better if you could just click where you want to go?

![screen shot of game 26, "Chomp"](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/904hij3u95e5jk09u4lc.png)

Many of the other games are even worse; in some cases the game board scrolls off the top of the screen, but you are _still_ expected to enter coordinates based on it, which is a real pain.  Any of these could be dramatically improved with a little Mini Micro TLC.

If you do improve any of these games, let me know!  I'd love to see what you do.