Updating "101 Basic Computer Games" for 2022 and beyond

Here’s a topic to capture some thoughts on this potential project.

I initially started thinking about it when I discovered this 2010 reboot:

But I was really disappointed in the resulting updated code, I feel like an opportunity was missed to demonstrate better coding patterns that have emerged since the 1970s. I don’t mean super fancy, complex things, but stuff as simple as, y’know, subroutines? Like James Shore said here

https://www.jamesshore.com/v2/blog/2006/quality-with-a-name

So I asked on Twitter and got a lot of responses:

https://twitter.com/codinghorror/status/1351289297760968705

I’ll update this as I figure out more and carve it into a blog post, possibly?

4 Likes

And YES, I am asking the relevant parties for permission to do this. We aren’t going to publish a book or anything but a website, available to all as a learning resource and part of computing history, would be nice!

1 Like

The wikipedia entry on the book is here

and aha, there were two versions of the book!

The first version, 101 went into a second printing and eventually sold 10,000 copies. Ahl later noted that “was far more books than there were computers around, so people were buying three, four, five of them for each computer.”

The second version, BASIC, was re-printed many times and was the first computer book to sell a million copies. Harry McCracken called it “The single most influential book of the BASIC era”

I’ve created a repo while we mull this over

1 Like

I contacted Mr. Ahl by email. He said this work is almost in public domain. But of course, proper permission should be granted.

2 Likes

I thought I’d make a start by converting the first game, AceyDucey, across to C# (.NET Core 3.1). I personally find this version MUCH easier to read than the original! Feel free to criticise or suggest improvements.

I’ve put the code online here:

Adam.

2 Likes

Thanks @lskbr and @AdamDawes575 – I have updated the github repo with a basic structure – let me know if you have any feedback on structure before we proceed?

(I need to write a lot more about guidelines, instructions, goals – mostly we want the gameplay to be completely the same, but with modern coding practices behind the scenes, relative to the language the game is being translated to…)

1 Like

It looks great. What is the plan? Should we fork the repo for each language? Or add a folder for each language version?

I wrote an article to convert an Apple ][ Basic game to Python: Convertendo um jogo escrito em Basic para Python - Parte I :: Nilo Menezes — Ex-junglecoders (in Portuguese, please use chrome to have it in English, just the code is important for the example). What I did was to add the original basic program at the top of the new version, let it commented out and write the translated version just after. The result is a mix of Basic and Python.

For Rust, I wrote a few text console helpers here: [GITHUB] /lskbr/spacegames
And for Python, I have another library for console here: [GITHUB] /lskbr/colorconsole
I know Miguel Icaza implemented a super text console library for C#, but I don’t have the link. I’m not sure if it is a good fit, as it is probably more like ncurses, changing a lot from the basic programming model, but I may be wrong :smiley:

I think we can also write a readme.md for each translation commenting on the challenges on each of them.

2 Likes

Here’s a nice visual intro of why the book mattered – featuring the actual book! :star_struck:

1 Like

OK cool! I’ve updated the repo with

  • better instructions, reduced focus to the first book
  • as suggested by @lskbr, one subfolder per target language (csharp, java, javascript, python, ruby, vbnet)
  • added readme.md per subfolder (as Git doesn’t support empty folders)
  • added @AdamDawes575 c# version of Acey Ducey

Repo is here:

1 Like

Just rolling into this thread after seeing mention on Twitter. I grew up with these books and still have my copies, albeit in rough shape. Wouldn’t might taking a crack at transliterating a few of them!

Probably going to attempt Super Star Trek if no one else gets to it first. I remember trying to convert that over to Star Trek: The Next Generation on a C64.

One semi-random thought: It would be very cool if this repo were somehow usable & hackable as a Glitch project for in-browser tinkering.

2 Likes

I’m looking at converting BOXING over to Python. Since the aim is to teach, I’m wondering if it makes sense to encourage the student to write the programs in a order that makes sense. We don’t want to start with some random sub routine, do we? For instance, a Python port would start with a “if name == ‘main’:” block calling “play()”. The play function would then iteratively be filled in along with any other supporting functions and data structures. This would be in contrast to a BASIC program which is almost obligated to be written linearly (I’m looking at you line numbers). I bring this up, because I feel like capturing the spirit of the original material implies we consider how the student is to learn from typing these programs. It’d be a bit more like a Bob Ross painting than a dot matrix print out.

2 Likes

Hmm, good points raised – I think we can safely assume these won’t be typed in, so I’d generally favor clean programming practices (commenting, subroutines, simplicity, taking advantage of built in language features) over everything else.

1 Like

Looking good! This should be interesting. Have you considered a way of allowing people to “register” for implementing a project in a particular language? Just to avoid duplication of effort.

I think I’ll need to make some revisions to C# Acey Ducey in order to follow the Stay true to the original program guideline – I added some features, and on reflection the coloured console text may look pretty in execution, but adds unnecessary complexity to the code.

2 Likes

I will try to contribute game versions in Go

2 Likes

Looks great! Thanks for putting this together.

Since I have just recently finished a massive blog series on Life, I’ll start with a C# implementation of #55.

2 Likes

Yeah I hadn’t actually considered that – but I have mixed feelings about letting people “sign up” as they might sign up, and not progress at all, or sign up for too many things over enthusiastically, and block others from progressing…

So I’m leaning toward the status quo at the moment. Stubs aren’t really desirable. If you have something finished, check it in!

At the very least, I can assure you no work will be lost – we can have multiple implementations in each language.

1 Like

Fair enough. With respect to commenting, do we want comments to refer to the translation effort or more specifically on the modern implementation? For example, I would imagine this would create a lot of comments about 0 vs 1 indexing of arrays or how conditions differ in a more structured language vs BASIC. Just want to get an idea of what is expected.

2 Likes

I think both! One example: I believe the examples should be extended to work with uppercase and lowercase.

1 Like

Agreed. We need to be flexible with inputs. “Yes”, “yes” “YES” should all be equivalent inputs. However, I would like to posit that all outputted characters should remain exclusively in caps, cause IT LOOKS ENDEARING.

Okay, in the context of the end of that last paragraph it looks like shouting, but in the console it looks endearing. :slight_smile:

4 Likes

Does the use of modern language features in the place of some more round about code (e.g. The BASIC version Hangman uses an INT array to mark whether a letter has been used yet, while Python can do the same by adding letters to a set) extend to algorithms affecting behavior? I ask this, because the AI code for TicTacToe2 depends quite heavily on the non-structured GOTO (I can almost hear Dijkstra now) and translation is quite challenging. I believe I have a workable strategy, but wanted to know if replicating behavior perfectly is a requirement or if we slip in a different algorithm that does the same job (an analogue to array iteration vs set key lookup). I say this as my translation is quite convoluted. Alternatively, a successful translation may serve as an illustration of how stark the programming styles can be.

Chuckles I think I’d have an easier time translating this particular one to NES.

2 Likes