Updating "101 Basic Computer Games" for 2022 and beyond

My apologies, looks like one has already been added!

2 Likes

Sorry for bothering everyone with what is probably a PEBKAC issue… I have a Java solution for 46 (Hexapawn) but I can’t seem to push it to the repo, despite being able to clone and pull just fine. I’ve had like 20 open tabs worth of StackOverflow solutions in an attempt to fix, but I can’t seem to get anything except a 403 back from a git push. Have tried all combinations of https and git@ versions of the git url, and have generated a Personal Access Token like github seems to want these days, and am entering that as my password, but nothing works. It knows it’s me, as putting in an incorrect password or token gives a different error.

If anyone can tell me what their push url looks like, from a ‘git remote show origin’, I’d appreciate it (I have https://git@github.com/coding-horror/basic-computer-games.git at the moment, which AFAIK should be correct). Or any other ideas as to what the problem might be…

2 Likes

Ah man this project is awesome!

Doing God’s work for sure.

@Zev_Spitz I’m going to be that unhelpful person to say I use Emacs’ basic-mode and it highlights both classic Basic and .net VB

3 Likes

Hey all! I recently stumbled upon this project through a video and I was wondering if there was a list somewhere of conversions which are already fully finished, thanks!

2 Likes

Nothing new about that, unfortunately. VBA vs. Visual Basic · Issue #2418 · github-linguist/linguist · GitHub Maybe use the GitHub editor? :grinning:

2 Likes

There are some small programs in the 00_Utilities folder which, when run, will tell you which implementations are currently missing.

2 Likes

I’m very happy when I found this utility. Unfortunately, it didn’t work on Windows. So, I have updated the Python version of the utility. I believe it can both work on Windows and Linux now.

2 Likes

I tried again to figure out how to push to the shared repo, and failed. Not sure what else to do, so I’ve pushed my Java solution for 46_Hexapawn to a personal repo: GitHub - schnitzi/Hexapawn: Implementation of Hexapawn for the CodingHorror project. If someone with proper access configured could add it to the common repo, that would be great… Thanks!

2 Likes

hello all awesome people here . I am a python programmer . and a rust fanboy . i want wanted to contribute the project in python , rust , js and go . can someone please guide me how to get started.

2 Likes

You need to start over a little bit, to contribute. Basically, you need to have github create a copy of Atwood’s repository in your name, and then use their website to message him to merge your branch into his.

  1. Navigate to Atwood’s repository
  2. in the top right, click on the fork button (this creates your repository/branch)
  3. clone your repository
  4. commit your changes
  5. push your changes back to your gh copy
  6. create a pull request by clicking on the pull request button on the main page of your repository, middle top right, below the green code button.
  7. ensure you have selected Atwood’s branch (main) as base and your branch as compare.
  8. fill in the message about your request

Hopefully, you understood those steps. At some point, Atwood will visit gh and interact with your pull request, perhaps acccepting, commenting on, or rejecting it.

(Edited because I initially only explained the pull request, and hadn’t yet seen that computronium had not created a gh fork.)

2 Likes

:loudspeaker: Update! TL;DR Pascal is replaced with Rust, Lua is added, Kotlin is added. Total of 10 languages (it was 8 before).

Specifically

  • we can’t guarantee memory safety with Pascal, so we’ve swapped it with Rust, which definitely can guarantee memory safety even though I wouldn’t really consider this a scripting language per se… It’s 26th in TIOBE but hopefully will “rise up” :point_up_2:

  • We added Lua since it cracked the top 20 and strongly meets the “scripting” and “memory safe” goals. :+1:

  • We added Kotlin as a Java alternative, basically Java for people who have a problem with Oracle, which I can totally understand :wink:

That gives us TEN target languages:

  1. C#
  2. Java
  3. JavaScript
  4. Kotlin
  5. Lua
  6. Perl
  7. Python
  8. Ruby
  9. Rust
  10. VB.NET

TIOBE as of March 2022:

I’ve also added an 00_Alternate_Languages folder so anyone who wants to contribute a port to a language that isn’t on the list can do so in the same repository.

1 Like

For people who are interested in the Python parts: Which Python version should I use? · Issue #661 · coding-horror/basic-computer-games · GitHub - please share which version you are using to develop / execute code :slight_smile:

3 Likes

I’m shocked I didn’t find out about this project sooner! QBASIC was my first programming language, and we had PDFs of this book at our school in Egypt for those students who wanted to make their own games after finishing their assigned classwork in the labs.

It’s sad to see so much of the Python ports are done already. I want to take the lead on the Python port for LIFE-2! (It’s one of the three remaining ports under Python that have not been completed).

2 Likes

Nearly done! I may consider doing the C# port for the same game as well!

2 Likes

Just fixed the issue in my pull request for game #56 Life for Two’s Python validation checks and followed the directions thrown by the debug console.

Apparently I was missing an import from typing?

Also I feel there is a small error in my code which I am unable to grasp and would love others’ input and collaboration on helping me understand the fix should my pull request be approved. (love open source!)

Will definitely attempt C# once the Python port has been fully reviewed :smile:

Thanks!

2 Likes

On one hand I totally get the need to limit the number of languages. But is the reason C is excluded, really due to not being a “scripting language” and is “memory unsafe”?

On the other hand, C is #2, so it’s important (even if it’s popular to dump on C these days). Remember also, these are mostly simple console apps… not client-server infrastructure running in an unnecessarily elevated user context.

I’d argue since C is not scripted, there’s a certain level of knowledge to do anything more with it than read/study. (Unless, of course, the C gets compiled to WebAssembly using Emscripten… then it can run in a browser sandbox <grin>).

So I’m asking that the root folder accept a 00_Unsafe_Languages. I’m porting a couple of these games to C anyways, in my own a private repo. I’m targeting C89 in particular, so it can be compiled by CC65, the 6502 cross-compiler. But it’d be nice to work with others on it; I’ll probably lose interest before I get anywhere close to finishing them all.

3 Likes

With the readme update – thanks for that – it’s clear that we do accept implementations in basically any language (in the proper folder), but only the defined ones count toward the donation and our overall original project goals, e.g. memory safe scripting type languages.

1 Like

This interpreter, for R (3.3+) and Python (3.9+), runs unmodified listings from the (1978-1980) Altair/Microsoft BASIC editions of the books:

https://pypi.org/project/brassica/

https://CRAN.R-project.org/package=brassica

Can’t promise it runs absolutely everything, but I’ve yet to hit an exception.

Some caveats:

  1. File I/O and hardware-hitting POKEs are not supported.
  2. When multiple errors exist within a statement (e.g., a type-mismatch and a syntax), you might not see the same error message (of those two possibilities) that the original interpreter would have raised.
  3. Gaps in the Altair manual, and some generalisations of the language, were filled-in by working backwards from Commodore 64 BASIC v2 in the VICE emulator (e.g., behaviour of consecutive unbracketed unary operators).
  4. The (ten) sample programs included with the package have had some tweaks; primarily bug-fixes. Numerical directions for Seabat and Super Star Trek have been re-mapped to the keypad.
1 Like

Exceptions found:

  • A small number of listings from the books call RND(X) where X is neither 1 nor 0. These should be changed to RND(1).
  • Joust is the only program to use IF-THEN-ELSE. Since ELSE is not supported by the above interpreter at this time, each of the three ELSE lines needs to be split.
2 Likes

With apologies for the spam, the delay, and not doing this in the first place; the interpreter has been updated to support IF-THEN-ELSE and RND(X) for any numeric X. Line 4100 of Joust (IF S=T AND…) still needs tweaking to stop the interpreter reading ‘TAN’ (parentheses, or flip S & T). The Python version is available now, but it could be several days before the R version (and PDF manual) is published.

2 Likes