101 BASIC Computer Games

(github.com)

94 points | by sohkamyung 12 hours ago ago

62 comments

  • carrja99 10 minutes ago

    Oh wow this is a trip down memory lane. My parents bought me a computer advertised in the classified ad as “includes over 100 games” and that really meant it came with a book over 100+ games in basic. I’d stay up copying the book to play the games in it. Fun times.

  • vunderba 10 hours ago

    If you are craving a BASIC fix, I highly recommend getting a DOS emulator like DosBos-X and just installing a copy of Quickbasic 4.5 (which has a compiler among other niceties over the original Microsoft QBASIC). You can easily find it on the Internet Archive.

    There are modern variants like QB64, but personally I find that BASIC really loses a lot of its appeal/flavor when you move from an interpretative language to a compiled one.

    https://dosbox-x.com

    I made this a while ago and it ran beautifully in DosBox on my Mac:

    https://specularrealms.com/q-basic

    • anta40 26 minutes ago

      Or FreeBASIC (it has QB compatibility mode). No macOS port, unfortunately.

    • tuveson 5 hours ago

      If anyone is interested, I just wrote a TinyBasic implementation:

      https://github.com/danieltuveson/dbi

    • 3036e4 5 hours ago

      I prefer GW-BASIC 1.0, as open sourced by Microsoft a few years ago, but with some changes to make it possible to build it easily yourself:

      https://gitlab.com/tkchia/GW-BASIC

      Also do a pip3 install pcbasic to get this great reimplementation of BASICA/GW-BASIC done in python for modern systems: http://robhagemans.github.io/pcbasic/

    • pjmlp 4 hours ago

      There is no reason to lose anything, hence why many BASIC still do support both ways of working.

      I bet many are unaware of many dynamism is still present in VB.NET, pity BASIC is no longer a darling language at Microsoft headquarters, and gets the bench on Sunday games.

    • ForOldHack 9 hours ago

      I was craving a BasicA fix, so rather than run the ROM extractor on an IBM, I found the extraction program with them extracted. No 43-line mode like qbasic... :(.

    • anthk 2 hours ago

      Bas will run straight:

      http://www.moria.de/~michael/bas/

      There's no need to run QB 4.5 and a full VM.

  • DigiEggz 5 hours ago

    It's so entertaining to just pour through the source for each game and read the language used at the time, like in the game instructions or result responses.

    There's something refreshing about seeing things described in different ways than they are now. I always wonder if some long forgotten words of phrasings will make their way back into public consciousness.

  • Erwin an hour ago

    I found the backslash as separator of multiple statements on one line curious. I guess that's because I was used to BASIC on the Commodore C-64/128/Amiga and later the magical Amos Basic, so there were more differences in some of the other dialects.

  • musicale 3 hours ago

    I'm greatly inspired by the kind of utopian visions of computing that seemed to be common from the BASIC era to the PC era to the pre-Facebook Internet era.

    I'm somewhat disenchanted with commercial computing from the social media and smartphone era to the modern AI era, even though it is impressive and technically interesting.

  • chasil 7 hours ago

    I remember variants on this for several platforms by the authors:

    Don Inman, Ramon Zamora, Bob Albrecht.

    TRS-80: https://www.amazon.com/Advanced-TRS-80-Level-II-BASIC/dp/047...

    TI-99/4a: https://www.amazon.com/Introduction-TI-BASIC-TI-99-4A/dp/081...

    Visual basic for dos: https://www.amazon.com/Visual-MS-DOS-Prentice-Innovative-Tec...

    VIC-20: https://www.amazon.com/Vic-BASIC-User-Friendly-Guide/dp/0835...

    Here is the full TRS-80 text: https://archive.org/details/trs-80-level-ii-basic-a-self-tea...

    Who were these guys? They were all over the map.

  • saneshark 5 hours ago

    I don’t see gorillas.bas — that was my favorite. I actually found my appreciation for writing code modifying lines of code in that game to make bigger explosions.

    • nurettin 4 hours ago

      nibbles was my favorite. Reading the code as a 13 year old I learned that they doubled y resolution by using lower and upper square ascii characters. It inspired me to find creative solutions for problems.

  • jasperry 10 hours ago

    Many happy memories of checking out books like this from my public library and trying to get the programs working on the C64. The BASIC dialect never matched exactly.

    • kreelman 9 hours ago

      Similar for me in my early teens. I used an Australian machine called the Microbee, https://www.microbeetechnology.com.au/classic-plus-kit-compu...

      A clever friend of mine wrote BASIC games that he sold back then. I think they had a bit of Z80 assembler built into it too.... Can't remember what names of them were though.

      The 'hires' graphics mode (511*255, monochrome) were encoded into sprites. There were only 128 characters from memory. There were all sorts of tricks to try and get around that issue.

      The best games used the sprites plonked into char positions.

      • smackeyacky 8 hours ago

        The ‘bee was how a lot of us Australians of a certain age got into computers. The only real competition it had was the C64 as other things like the Apple II and IBM compatibles were just too expensive in comparison to that $399 intro price.

        It was a bit weird to program for, as you said the basic was not quite the same as the popular platforms. It did mean you learned a lot about the machine itself, how memory was laid out, how to get those PCG graphics right.

        It’s funny now to be able to see very similar cultures sprang up around less successful machines in other countries.

    • alisonatwork 9 hours ago

      Me too, except with the CPC. After going through enough of them, I got to a point I could flick through the book in the library and figure out what was going to work ahead of time, what could be adapted and what went way beyond my abilities (usually anything that shoveled machine code into DATA blocks). It was neat imagining the incredible capabilities of computers other than my own and then trying to figure out a way to make mine do something like it too.

  • genghisjahn 8 hours ago

    I loved Amiga Basic. My first taste of programming without line numbers.

    • bemmu 4 hours ago

      I was in primary school when I heard about AmigaBasic. I was incredibly excited by it, I told my friend it would make it possible for us to build anything, for example we could build an ice hockey game. I hated ice hockey. I was just so excited that building anything at all with it seemed amazing.

      But it turned out it was basically unusable on a TV because of the narrow cursor and difficult to read font. But AMOS was great, and we built a simple one-room adventure game prototype on it.

    • kbelder 4 hours ago

      Amiga Basic still seems to me like the pinnacle of the basic language. Line numbers were optional, structured programming with loops and true functions, a graphics library... but still firmly BASIC. Not bits of code embedded in a UX editor, not some compiler-based C wannabee...

      • pjmlp 4 hours ago

        Dartmouth BASIC was designed as compiled on the fly language, no interpreter.

        As for C wannabe, BASIC got famous before C had any meaningful meaning outside Bell Labs.

        • musicale 2 hours ago

          I think "C wannabe" is a complaint about some modern BASICs trying to be too much like C.

          Dartmouth BASIC and timesharing were remarkable achievements: a simplified version of Fortran that could be learned in an afternoon but could be used for a wide variety of programs, including games; a fast, interactive compiler; and efficient resource usage and multiplexing that enabled a single machine to be shared by dozens (?) of interactive users. BASIC was also simple enough that it could be implemented compactly and efficiently on 8-bit microcomputers, while retaining its ease of learning for beginners and non-experts. And you could still write/run games with it.

  • sudofoo 3 hours ago

    Were line numbers in old BASIC games actually helpful, or just extra typing?

    • jamalaramala 28 minutes ago

      They were essential for branching with GOTO and GOSUB.

      Example:

          10 PRINT "HELLO ";
          20 GOTO 10
      
      This would create an infinite loop that you could break with Ctrl+C.

      You could then type:

          15 PRINT "WORLD ";
      
      And when you listed the source code (with the command LIST) you would see:

          10 PRINT "HELLO ";
          15 PRINT "WORLD ";
          20 GOTO 10
    • femto 3 hours ago

      They were required for most early BASIC interpreters. They acted as a label for goto statements and determined the listing/execution order. From memory, the TRS-80 (and similar) would immediately execute a statement without a line number, but would store a statement with a line number.

      • fifticon an hour ago

        To elaborate on that: They were the handle on the code lines, for anything. You would often use the line number to either edit a given line number, or to remove it. 'Clever' people would even do mis-guided arithmetic on them, e.g.

          GOTO  MenuChoiceNum\*100 + 1000
          GOSUB MenuChoiceNum\*100 + 1000
        • codr7 7 minutes ago

          Wow, it hurts to imagine maintaining and evolving that code :)

      • a_e_k 3 hours ago

        They were also how you edited your program in the absence of a coding editor. You'd type LIST to see your current program, type a new line with the same number to replace an existing line, or a new line with a new number to insert it numerically, etc.

        • musicale 2 hours ago

          Dartmouth BASIC was designed for teletype-style, hard-copy printing terminals, rather than video displays. Conveniently your whole session was printed out, so you could take your email and program listing home with you. Line-by line editing was practical for printing terminals, and line-by-line I/O scaled well across multiple terminals on a timesharing system.

          Line editing also worked well on microcomputers with cursor movement (like the C64) - you could edit code in place just by overtyping and hitting "return" for the appropriate line.

          On a slightly unrelated note, teletypes date back to the 19th century telegraph (and typewriter) era.

          https://en.wikipedia.org/wiki/Teleprinter

        • femto 3 hours ago

          And it was an absolute pain if you had to insert a new statement, but didn't have enough space left between line numbers. You had to retype the offending lines with new line numbers.

          • musicale 2 hours ago

            Dartmouth BASIC had a renumber command. I believe that line renumbering commands and/or utilities were commonly available for microcomputer BASICs as well.

            • femto 2 hours ago

              Some BASICs had a RENUM command. They were a bit of a pain as well. As you wrote your program you got to know which line numbers were associated with which statements. Doing a RENUM meant having to relearn the "meaning" of each line number. I'm pretty sure my VZ-200 didn't have the RENUM command.

          • ahonhn 2 hours ago

            Common practice was to increment line numbers by 10 instead of 1. Would give a bit of wiggle room to add more lines in later without having to renumber everything else.

  • wduquette 7 hours ago

    This exact book is how I learned to program, back in the late ‘70’s. Lots of good memories.

    • a_e_k 3 hours ago

      I picked up my copy of the microcomputer version at a neighborhood rummage sale in a park as a young kid. It's one of the earliest things from my childhood that I still have. Good times.

    • ForOldHack 5 hours ago

      This is the book on how to write practical games. If DEC had not shafted Ahl, I would have been on real DEC instead of an HP.

      DEC could have ruled the world.

    • TMWNN 4 hours ago

      Walter Bright said here that he learned programming from this book.

  • dang 8 hours ago

    Related. Others?

    Updating “101 Basic Computer Games” for 2021 - https://news.ycombinator.com/item?id=26273866 - Feb 2021 (65 comments)

  • BrenBarn 3 hours ago

    The Dave Ahl books were one of my first introductions to programming. They're still awesome.

    • musicale 2 hours ago

      I wish modern computer companies to hire people to create material like this, the way DEC apparently did. Unfortunately computers aren't really programmed by end-users anymore. Arguably there's no need to between a million apps on one hand and AI on the other.

  • zkmon 4 hours ago

    Looks like no Qbasic games? Nibbles, Gorilla - love to see them included.

    • hnlmorg 4 hours ago

      Literally the first line of the README explains why:

      > This folder contains the programs found in the March 1975 3rd printing of David Ahl's 101 BASIC Computer Games, published by Digital Equipment Corp.

  • anthk 2 hours ago

    I would love this for Forth :)

    Yes, everyone had and has run these either on micros or bwbasic/blassic/bas, but porting these to Forth would be really cool.

  • khazhoux 9 hours ago

    Would be better if the programs were JPGs that you had to type in

    • a_e_k 2 hours ago
    • ForOldHack 9 hours ago

      MS Office OCR works great for this, it did the Rogue.c jpegs in no time, but there are missing routines. I wonder if an AI could fill the gap.

      • Mountain_Skies 8 hours ago

        A listing made on a dot matrix printer that contain PETSCII graphic characters might make it struggle. It'd be interesting to see if the LLM could infer the intended character.

        • ForOldHack 5 hours ago

          I ment fixing the missing code blocks, of would suppose that an LLM could fix the mangled code without OCR training...

  • Narishma 8 hours ago

    Are any of the games any good?

    • ForOldHack 5 hours ago

      The game of life is still being persuied relentlessly, the lunar module program was cooked by a NASA drop-out. Hamarabi is about to get cooked. Monopoly I do not think can be published.

    • anthk 2 hours ago

      Golf.bas it's almost a Neo Turf Masters game in text mode.

      Super Star Trek it's good too; and there are modern ports such as Super Star Trek from ESR in Python which expand the game a lot.

      Also, BSD users have installed the old one, written in C, at /usr/games/trek.

               man trek
  • TMWNN 4 hours ago

    Among the most important computer books ever written, on the level of SICP and K&R.

    Walter Bright said here that he learned programming from this book.

  • shmerl 5 hours ago

    No gorilla.bas?

  • prvc 10 hours ago

    BASIC, that is.

    • dang 8 hours ago

      We've put an ASIC in there. Thanks!

    • esafak 9 hours ago

      The title should be corrected.