Welcome to ALTAIR BASIC! This guide will help you take your first steps with this historic programming language.
ALTAIR BASIC is a programming language created by Bill Gates and Paul Allen in 1975 for the MITS Altair 8800, one of the first personal computers. This modern interpreter lets you write and run BASIC programs on today's computers.
After installing the program (see README.md for installation instructions):
- Start the interpreter
- You'll see a welcome message and a
Ready>prompt - Now you can start typing commands or program lines
Let's create a simple program that prints a message:
-
Type the following lines (press Enter after each line):
10 PRINT "HELLO, WORLD!" 20 PRINT "THIS IS MY FIRST BASIC PROGRAM" 30 END -
Run your program by typing:
RUN -
You should see the messages displayed:
HELLO, WORLD! THIS IS MY FIRST BASIC PROGRAM
Here are some essential commands to get you started:
LIST- Shows your current programNEW- Clears the current program to start overSAVE filename- Saves your program to a fileLOAD filename- Loads a program from a fileRUN- Executes your program
BASIC lets you store values in variables and perform calculations:
10 LET A = 5
20 LET B = 10
30 LET C = A + B
40 PRINT "THE SUM IS"; C
50 END
You can get input from the user with the INPUT command:
10 PRINT "WHAT IS YOUR NAME?"
20 INPUT N$
30 PRINT "HELLO, "; N$
40 END
Use IF...THEN to make decisions in your program:
10 PRINT "ENTER A NUMBER"
20 INPUT N
30 IF N > 10 THEN PRINT "THAT'S A BIG NUMBER!"
40 IF N <= 10 THEN PRINT "THAT'S A SMALL NUMBER!"
50 END
Use FOR...NEXT to repeat code a specific number of times:
10 PRINT "COUNTING FROM 1 TO 5:"
20 FOR I = 1 TO 5
30 PRINT I
40 NEXT I
50 END
Try loading and running some of the example programs to see more possibilities:
LOAD examples/hello.bas
RUN
Type HELP at the prompt to see a list of available commands.
BASIC was designed to be easy and fun to learn. Don't worry about making mistakes - experiment, learn, and enjoy the experience of programming like people did back in the early days of personal computing!
For more detailed information, see the README.md file or explore the example programs in the examples folder.
Happy coding!