Giter Site home page Giter Site logo

dafyddcrosby / basic-computer-games Goto Github PK

View Code? Open in Web Editor NEW

This project forked from coding-horror/basic-computer-games

0.0 2.0 0.0 74.67 MB

An updated version of the classic "Basic Computer Games" book, with well-written examples in a variety of common MEMORY SAFE, SCRIPTING programming languages. See https://coding-horror.github.io/basic-computer-games/

License: The Unlicense

Shell 0.05% JavaScript 17.39% Ruby 3.59% Python 12.44% Perl 7.32% C 0.62% Java 16.00% Lua 0.12% D 0.61% Go 0.03% C# 18.16% Rust 5.46% Kotlin 0.95% CSS 0.08% Pascal 0.54% Elm 0.38% HTML 0.83% Visual Basic .NET 1.31% BASIC 14.11%

basic-computer-games's Introduction

What are we doing?

We’re updating the first million selling computer book, BASIC Computer Games, for 2022 and beyond!

Where can we discuss it?

Please see the discussion here for a worklog and conversation around this project.

Project structure

I have moved all the original BASIC source code into a folder for each project in the original book (first volume). Note that Lyle Kopnicky has generously normalized all the code (thanks Lyle!) to run against Vintage Basic circa 2009:

I’ve included all the games here for your tinkering pleasure. I’ve tested and tweaked each one of them to make sure they’ll run with Vintage BASIC, though you may see a few oddities. That’s part of the fun of playing with BASIC: it never works quite the same on two machines. The games will play better if you keep CAPS LOCK on, as they were designed to be used with capital-letter input.

Each project has subfolders corresponding to the languages we’d like to see the games ported to. This is based on the 2022 TIOBE index of top languages that are memory safe and general purpose scripting languages per this post:

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

📢 Note that in March 2022 we removed Pascal / Object Pascal and replaced it with Rust as we couldn’t determine if Pascal is effectively memory safe. We’ve also added Lua, as it made the top 20 in TIOBE (as of 2022) and it is both memory safe and a scripting language. The Pascal ports were moved to the alternate languages folder.

⚠️ Please note that we have decided, as a project, that we do not want any IDE-specific or build-specific files in the repository. Please refrain from committing any files to the repository that only exist to work with a specific IDE or a specific build system.

Alternate Languages

If you wish to port one of the programs to a language not in our list – that is, a language which is either not memory safe, or not a general purpose scripting language, you can do so via the 00_Alternate_Languages folder. Place your port in the appropriate game subfolder, in a subfolder named for the language. Please note that these ports are appreciated, but they will not count toward the donation total at the end of the project.

Project goals

Feel free to begin converting these classic games into the above list of modern, memory safe languages. In fact, courtesy of @mojoaxel, you can even view the JavaScript versions in your web browser at

https://coding-horror.github.io/basic-computer-games/

But first, a few guidelines:

  • These are very old games. They date from the mid-70s so they’re not exactly examples of what kids (or anyone, really?) would be playing these days. Consider them more like classic programming exercises to teach programming. We’re paying it forward by converting them into modern languages, so the next generation can learn from the programs in this classic book – and compare implementations across common modern languages.

  • Stay true to the original program. These are mostly unsophisticated, simple command line / console games, so we should strive to replicate the command line / console output and behavior illustrated in the original book. See the README in the project folder for links to the original scanned source input and output. Try running the game in your browser. Avoid the impulse to add features; keep it simple, except for modern conventions, see next item 👇

  • Please DO update for modern coding conventions. Support uppercase and lowercase. Use structured programming. Use subroutines. Try to be an example of good, modern coding practices!

  • Use lots of comments to explain what is going on. Comment liberally! If there were clever tricks in the original code, decompose those tricks into simpler (even if more verbose) code, and use comments to explain what’s happening and why. If there is something particularly tricky about a program, edit the Porting Notes section of the readme.md to let everyone know. Those GOTOs can be very pesky..

  • Please don’t get too fancy. Definitely use the most recent versions and features of the target language, but also try to keep the code samples simple and explainable – the goal is to teach programming in the target language, not necessarily demonstrate the cleverest one-line tricks, or big system "enterprise" coding techniques designed for thousands of lines of code.

  • Please don't check in any build specific or IDE specific files. We want the repository to be simple and clean, so we have ruled out including any IDE or build system specific files from the repository. Git related files are OK, as we are using Git and this is GitHub. 😉

Emulation and Bugfixes

We want the general behavior of the original programs to be preserved, however, we also want to update them, specifically:

  • allow both UPPERCASE and lowercase input and display
  • incorporate any bugfixes to the original programs; see the readme.md in the game folder
  • improved error handling for bad or erroneous input

Please note that on the back of the Basic Computer Games book it says Microsoft 8K Basic, Rev 4.0 was the version David Ahl used to test, so that is the level of compatibility we are looking for.  QBasic on the DOS emulation is a later version of Basic but one that retains downwards compatibility so far in our testing. To verify behavior, try running the programs in your browser with JS BASIC, effectively Applesoft BASIC.

Have fun!

Thank you for taking part in this project to update a classic programming book – one of the most influential programming books in computing history – for 2022 and beyond!

NOTE: per the official blog post announcement, I will be donating $5 for each contributed program in the 10 agreed upon languages to Girls Who Code.

basic-computer-games's People

Contributors

anthonymichaeltdm avatar breedx2 avatar coding-horror avatar danielpiron avatar darrencardenas avatar dave-burke avatar drew-cooper avatar dyegomaas avatar havoclad avatar jamiemccarthy avatar jnellis avatar journich avatar kstolen0 avatar littletealeaf avatar martinthoma avatar mojoaxel avatar nanochess avatar nezumironin avatar pcholt avatar pczajkowski avatar pgruderman avatar poblish avatar qequ avatar rbamforth avatar ribtips avatar stevebosman avatar trwyant avatar tsmaster avatar ugurkupeli avatar zspitz avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.