Thursday, March 1, 2012

Classic BASIC Games

The Apple 1 (and Replica 1) uses a 6502 microprocessor which run a native machine code. Programming in machine code is hard - it is low level, very tedious, and hard to debug. Steve Wozniak realized when he designed the Apple 1 that it needed to be easier to use, so he wrote an implementation of the BASIC language for it to make the computer more accessible to new computer users.

BASIC, which stands for Beginner's All-purpose Symbolic Instruction Code, is a much easier language to learn and program in for beginners. I'd say it is roughly 100 to 1000 times easier to program than machine language. What is the price you pay for the ease of use? Because it is interpreted, it runs 100 to 1000 times slower that machine language. In many cases the speed is not an issue.

Woz's implementation of BASIC was developed by hand assembling it on paper into machine code and then typed in using the monitor. It fit in 4K of memory and came on cassette tape. The Replica 1 includes it in ROM so it can be loaded immediately.

In this blog posting I'll describe some of the BASIC programs available for the Replica 1. Most of these are classic games from the early days of personal computers and were written for the Apple 1 or written for similar computers and ported to the Apple 1.

The dialect of BASIC in the Apple 1 has a number of quirks and limitations. In a future posting I'll talk about this in more detail as well as some other implementations of BASIC available for the Replica 1. Overall though, it is quite usable and compatible with most dialects of BASIC from that era of early personal computing.

The classic book "101 BASIC Computer Games" by David Ahl collected many of the popular early games written in BASIC. When it was first published in 1973, most computers were mainframes or minicomputers accessible only to university students and faculty and employees of computer companies. I was fortunate to find a used copy a few years back.


With this book and a computer running BASIC, even a non-programmer could type in and run computer programs (although you typically had to make changes to adjust for the dialect of BASIC on your computer).

I also have a copy of the version from 1978, now called the "Microcomputer Edition" and updated to reflect the early computers popular at that time such as the Apple II, Radio Shack TRS-80, Commodore PET, and Ohio Scientific. Around 1980 I owned an Ohio Scientific Superboard computer and spent many hours typing in, debugging, and playing games from this book.


The Replica 1 comes with a CD-ROM that includes a number of BASIC games (about 30 or so). Here is a brief review of what I think are some of the better ones.

ACEYDUCEY

A card game similar to blackjack where you bet on whether a card dealt will be in between two cards that are shown.

BLACKJACK

The classic card game Blackjack or 21 where the goal is to get as close as possible to 21 without going over.

BOWLING

An interestring implementation of 10 pin bowling with the only graphics being "ASCII art" indicating the pins. It supports multiple players. There is no skill involved, the computer simply reports the randomly generated results of each roll of the ball.

CRAPS

A computer version of the gambling game played by rolling dice.

DEAL

An implementation of the "Deal or No Deal" game show. This is a newly written game for the Replica 1 by Vince Briel and it is very well done.

ELIZA

This is a BASIC version of the classic artificial intelligence program that acts as a psychotherapist. You have a conversation with the computer and it may help you to discuss your problems. It can be entertaining but won't pass the Turing test.

HAMMURABI

Hammurabi (often mispelled Hamurabi) is a game where you are the ruler of ancient Sumeria and have to decide how to manage the city: how much land to buy or sell, how much grain to feed the people, plant for crops, or keep in storage. If you don't choose wisely, people will starve or revolt. Surviving your 10 year term of office is the challenge.
HANGMAN

A nice implementation of the classic hangman word guessing game. It is quite well done using ASCII art to draw the character.

SLOTS

This is a simulation of a one armed bandit slot machine.

STAR TREK 2003

Star Trek was the most popular BASIC game of all time and various incarnations of it ran on every microcomputer and mainframe since it was written in the late 1960s. In the game you travel through the galaxy attempting to rid each quadrant of Klingons using phasers and photon torpedoes.
This version was ported to the the Replica 1 by Vince Briel in 2003 and runs very well. It lacks a few features of some of the larger versions but does an amazing job within the memory and limitations of
Apple 1 BASIC.

This is my personal favourite classic BASIC game.

SUDOKO

A new program written by Larry Nelson for the Apple 1. It generates Sudoko puzzles in one of three difficulty levels and can also display the answer.

WORDSEARCH

This program generates word search puzzles using words that you enter. It's probably only useful if you save and print out the puzzles.

WUMPUS

In this game you are in a cave with twenty rooms in the form of a dodecahedron where every room leads to three other rooms. Your goal is to hunt down and shoot a creature called the Wumpus using your bow and arrows. Hazards you may encounter include bottomless pits and super bats.

This is a classic game but for some reason is not included in the 101 BASIC Computer Games book.

Entering these classic programs onto the Replica 1 is a lot of fun and a good way for non-programmers to get started.

Be warned though: One of the pioneers of computer programming, Edsger Dijkstra, said that programming in BASIC would ruin you as a programmer for life. It is too late for me, the first programming language I learned was BASIC.

2 comments:

The Geeks said...

http://computer-awareness.blogspot.com/2013/07/computer-knowledge-practice-mcqs-for.html

Unknown said...

Useful and interesting article, it returns you to the past for a moment. This fun of my childhood. Now I rarely play, often only poker pokies online. It is comfortable and nice, especially when you win a lot of money. This is a good way to earn money, especially nice to do it before Christmas.