Ah yes. One of the things I'll do when I'm learning a new computer language is pull out my now ancient copy of the 1973 edition of the book and just convert one of these games to the new language. The conversion might not look very much like the original when I'm done, but it is functionally equivalent. What I like about the approach is that the games in the book are small enough problems to solve as not really to be a major undertaking while being complex enough to be interesting.... and, of course, nostalgia.
Way back when copying these games from the book into a VIC-20 and C-64, along with a healthy dose of the 80's era computer magazine programs, were my introduction to programming. Having to convert between BASIC versions was part of the learning experience.
I remember "graduating" from Atari 8-bit BASIC to QBasic on an i386, and being blown away at how much more you could do, including switching graphics modes. I know a lot of people like to say that BASIC teaches you bad coding habits, but I think it also got young minds hooked into programming. If you had a deep interest, you unlearned those bad habits, but still kept that love of writing software. I still wish I could go back in time and feel what it was like to first gain a grasp of seeing your code perform some task, right in front of you.
"It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration."
-- Edsger W. Dijkstra
As someone who got their start with BASIC -- mainly from "BASIC Computer Games" no less -- I was always kind of offended at that quote.
As someone whose first language was BASIC, which led me down a path that eventually culminated in a CS Ph.D, I have also not been a fan of that quote.
It implies that Dijkstra was a terrible educator who could only truly teach blank minds. For all his imagination and creativity on theoretical CS and math, he was very rigid in other ways. Imagine a history professor saying that students who have been exposed to various myths and ideologies are mentally mutilated beyond hope, or a literature professor saying that students who have been exposed to pop culture retellings of the classics are mentally mutilated beyond hope.
Remember that Dijkstra looked down on anyone who wrote using word processors, because he thought any academic should be able to work out their argument in their head and just write it down. Eventually he came to even reject the mechanical typewriter.
Dijkstra's maxim is both harmful and clueless. Many of the greatest programmers in the world started with BASIC. When I "graduated" from BASIC to Pascal, I very quickly dropped the BASIC approach to program flow, as any software engineer worth their salt would do. Dijkstra infantilizes programmers, as if it wasn't obvious that BASIC's approach is cumbersome and people just keep programming C++ as if it was BASIC...
Once you go to a "proper" programming language, there is nothing to "unlearn". The new approach is so obviously better! At the same time, having an interpreter up within 2 seconds of turning the computer one was AMAZING and got a lot of people interested in programming.
Much of the software world you see today was built by people who started with BASIC!
BASIC is explicitly a beginner's language. It may not be the best design for advanced programming, but as an instructional tool for someone who doesn't even know what a program is, it's almost second to none. The lessons it teaches are profound: that programs are ordered sequences of instructions that computers can follow, that control flow can involve branching, loops, and conditionals and what those are, and the rudiments of breaking out a program into subroutines. This is a real mindblow for people who've never actually programmed before -- it means they can make the machine do what they want, even very sophisticated (from their perspective) things. It's only when you've seen better -- Algol, Pascal, Lisp -- that BASIC seems miserably wrong in comparison.
As for Dijkstra -- arrogance in computer science is measured in nanodijkstras.
Same, and I always hated that quote also. If anything, BASIC exposes you to low level assembly concepts: instructions are processed in order based on their 'address' (line number), unless you have a conditional, where you jump (goto) a new address. Variables are global by default, as they would be as data at an address in memory.
I suspect that BASIC may have got a bad reputation in the same way as PHP or JavaScript did, where the accessibility of the language and infrastructure around it allows people who just want to achieve a specific goal to easily participate.
That influx of people with the attitude of "I don't care how computers work, I just want to know enough to solve my problem" shifts the stereotypes around those language users and may erroneously put the fault of it onto the language itself. It certainly feels that way during hiring, where it seems like developers of vastly differing skill or aptitude tend to cluster heavily around certain "friendly" languages.
BASIC didn't really raise the abstraction level away from imperative statements and loops. It let us hack faster, but it didn't help us to write programs that were provably correct. I think that is what Dijkstra was getting at. He was worried students would think this was good enough. And he was right. BASIC influenced a generation, my generation. The generation that gave us arguably the next BASIC, Python. A language with little coherence, that mixes imperative commands and mutation with the lambda calculus; and has no static types. A language that makes easy tasks easier, but hard tasks harder.
It's a very Sapir-Whorf sentiment, that somehow we are infected by what we learn, unable to imagine outside of those formative experiences. And like Sapir-Whorf, also false!
Me too! I even maintained an application written in Visual Basic in my spare time while working with Java professionally. I can honestly say I have 20 years of experience in BASIC :D
I learned a lot about programming by taking a book like this that was written specifically for the TRS-80 (which I did not own), and translating the programs to what I owned instead, which was a Sinclair ZX80. This primarily involved translating between different flavors of BASIC, but also deciding what I could arrange to leave out and still have an interesting game, due to the relatively constrained resources of my machine. Excellent experience.
I learned a lot about programming by taking this book and, since I didn't own a computer, figuring out how the code could produce the example listing. That's where I learned things like, to swap the values of two variables, you copy one to a third variable temporarily. I learned a ton of patterns like that.
Eventually I got my VIC-20, then an Apple ][, then an Amiga.
Somewhat related trivia: Sid Meier's Pirates! for the Commodore 64 is written mostly in BASIC, coupled with assembly for parts requiring snappier performance (for example the full-screen scrolling while sailing).
I still cannot wrap my head around this. I was schooled about this fact by one of the C64 experts who frequent HN, and I'm still amazed.
C64 BASIC was terrible even for its time. Due to licensing issues, its capabilities lagged behind those of other BASICs from home computers of the same era. Everything cool you could do with it was basically cheating: PEEK and POKE. As a child, this frustrated me to no end. Even my friend with his Speccy had access to a better BASIC.
And still... Pirates! was made with Commodore BASIC.
It had to be a horrible experience for him since for sure he was familiar with other BASICs. One example: Prior to Pirates!, in 1982, Sid Meir made a game called Chopper Rescue in Atari 800 BASIC:
C64 BASIC had to be a step back, but that's where the sales were to be made. For example, in Atari 800 BASIC variables were not limited to two characters.
C64 BASIC was really PET basic from ~1976, very close to Microsoft's Altair BASIC.
C-64 BASIC V2 has all of the same important fundamentals that other BASICs of that era had. What mainly set it aside was the lack of dedicated graphical functions. What was available on the other home computers was on one hand too slow (or too limited) to be useful for pretty much any type of game development - forcing those platforms, too, to "cheat" by interacting with the hardware by POKEing around - but on the other hand fun and educational to explore graphics programming with. The exception would be the very capable BASIC of the Sharp MZ-700 which was of an entirely different class. For the C-64 there were plenty of third-party options.
That was a pretty common mix, I know mostly from the CPC, but it was the same in (another) green, basically.
Been a kid at that time, I run into performance issues with the BASIC-only approach pretty quick. Sadly I had no good books about assembly or knew someone knowledgeable about it.
Just select the game you want to to run from the top-left list box, then press the "Compile" button and you'll see the translated JS source in the right text-area. Then press the "Run" button to run it.
What I'd really like to see are the multiplayer games from the original 101 BASIC Computer Games ported to the web. I was too young to understand how those worked as a kid, and my dad's copy had some printing issues (occasional pages have white streaks across it).
EDIT: To clarify BASIC Computer Games != 101 BASIC Computer Games (the original has more than the microcomputer version including CANAM and DOGS)
There are copies of the book on eBay, so it is available if you want a better copy to work from yourself. A quick search finds copies on archive.org too, though you might have to check a few to find a good one (the one I just opened wasn't a very clear scan, the code was not particularly easy to read due to being a low-res scan of already low-quality text).
--
EDIT: having looked at the repository, it is reimplementing the games from that book in various languages, including javascript hosted in a web page, so for a direct translation it is exactly what you are looking for. If you want the multi-player ones to be playable between remote players, you still have some work to do!
The library in the city near where I grew up had some variant of this book in it. Unfortunately, the variant of BASIC was something that didn't compile on the 286 my parents had purchased and either I didn't ask or they couldn't help me at age ~5/6 to get around the compiler errors, and I thought I wasn't smart enough to be a programmer for about 8 years.
Then I got into the mid-wave mod scene in 1998, and I realized I had the wrong compiler, but man, I just thought I couldn't follow directions right.
Way back when copying these games from the book into a VIC-20 and C-64, along with a healthy dose of the 80's era computer magazine programs, were my introduction to programming. Having to convert between BASIC versions was part of the learning experience.
As someone who got their start with BASIC -- mainly from "BASIC Computer Games" no less -- I was always kind of offended at that quote.
It implies that Dijkstra was a terrible educator who could only truly teach blank minds. For all his imagination and creativity on theoretical CS and math, he was very rigid in other ways. Imagine a history professor saying that students who have been exposed to various myths and ideologies are mentally mutilated beyond hope, or a literature professor saying that students who have been exposed to pop culture retellings of the classics are mentally mutilated beyond hope.
Remember that Dijkstra looked down on anyone who wrote using word processors, because he thought any academic should be able to work out their argument in their head and just write it down. Eventually he came to even reject the mechanical typewriter.
Once you go to a "proper" programming language, there is nothing to "unlearn". The new approach is so obviously better! At the same time, having an interpreter up within 2 seconds of turning the computer one was AMAZING and got a lot of people interested in programming.
Much of the software world you see today was built by people who started with BASIC!
As for Dijkstra -- arrogance in computer science is measured in nanodijkstras.
That influx of people with the attitude of "I don't care how computers work, I just want to know enough to solve my problem" shifts the stereotypes around those language users and may erroneously put the fault of it onto the language itself. It certainly feels that way during hiring, where it seems like developers of vastly differing skill or aptitude tend to cluster heavily around certain "friendly" languages.
The fact that the first coding I did was mIRC scripting however should terrify everyone hahaha
well, as long as we aren't working on embedded code for pacemakers
in that case, we'll just skip to the first person in the stack of resumes who didn't start with basic
Deleted Comment
Play Basic Computer Games in the Browser - https://news.ycombinator.com/item?id=34377776 - Jan 2023 (1 comment)
Basic Computer Games (1978) - https://news.ycombinator.com/item?id=28572761 - Sept 2021 (12 comments)
Updating “101 Basic Computer Games” for 2021 - https://news.ycombinator.com/item?id=26273866 - Feb 2021 (65 comments)
Basic Computer Games (ported to C#, Java, JavaScript, Python, Ruby, VB.NET) - https://news.ycombinator.com/item?id=26188324 - Feb 2021 (3 comments)
BASIC Computer Games - https://news.ycombinator.com/item?id=19604142 - April 2019 (120 comments)
BASIC Computer Games (1978) - https://news.ycombinator.com/item?id=9026063 - Feb 2015 (31 comments)
Atari Archives: BASIC Computer Games - https://news.ycombinator.com/item?id=3200133 - Nov 2011 (23 comments)
BASIC Computer Games Book, published in 1978 - https://news.ycombinator.com/item?id=1866103 - Nov 2010 (36 comments)
Eventually I got my VIC-20, then an Apple ][, then an Amiga.
C64 BASIC was terrible even for its time. Due to licensing issues, its capabilities lagged behind those of other BASICs from home computers of the same era. Everything cool you could do with it was basically cheating: PEEK and POKE. As a child, this frustrated me to no end. Even my friend with his Speccy had access to a better BASIC.
And still... Pirates! was made with Commodore BASIC.
https://www.mobygames.com/game/41499/chopper-rescue/
https://www.youtube.com/watch?v=rUyebYD5UO0
C64 BASIC had to be a step back, but that's where the sales were to be made. For example, in Atari 800 BASIC variables were not limited to two characters.
C64 BASIC was really PET basic from ~1976, very close to Microsoft's Altair BASIC.
63999 F$ = "TOWN": PRINT "Saving "F$"...": PRINT "UNLOCK"F$: PRINT "SAVE"F$: PRINT "LOCK"F$: PRINT "DELETE/PIRATES/"F$: PRINT "SAVE/PIRATES/"F$: PRINT 27648 - ( PEEK (176) * 256 + PEEK (175))" bytes free": END
(The print strings actually have an embedded control-D / 0x04 so they're executed as commands rather than printed)
Been a kid at that time, I run into performance issues with the BASIC-only approach pretty quick. Sadly I had no good books about assembly or knew someone knowledgeable about it.
You can try it out in your browser at: https://codepen.io/kgr/full/yLQyLjR
Just select the game you want to to run from the top-left list box, then press the "Compile" button and you'll see the translated JS source in the right text-area. Then press the "Run" button to run it.
The source code for the compiler is available at: https://github.com/kgrgreer/foam3/tree/429f2fd2b4cef0e37996a...
EDIT: To clarify BASIC Computer Games != 101 BASIC Computer Games (the original has more than the microcomputer version including CANAM and DOGS)
This is a later printing than what I have -- http://www.bitsavers.org/pdf/dec/_Books/101_BASIC_Computer_G...
Or, for a web server experience, in that directory:
then go to http://localhost:8000/ .https://en.wikipedia.org/wiki/BASIC_Computer_Games
--
EDIT: having looked at the repository, it is reimplementing the games from that book in various languages, including javascript hosted in a web page, so for a direct translation it is exactly what you are looking for. If you want the multi-player ones to be playable between remote players, you still have some work to do!
https://annarchive.com/files/Basic_Computer_Games_Microcompu...
also there's a link that has web based running versions of the game:
https://troypress.com/wp-content/uploads/user/js-basic/index...
Then I got into the mid-wave mod scene in 1998, and I realized I had the wrong compiler, but man, I just thought I couldn't follow directions right.