An introduction to BASIC for the young (and young at heart!)
Best done under adult supervision (in the computer world, we call this ‘pair programming’!)
Welcome to Discoville! You’re trying to earn money doing odd jobs for people living on Disco Street, and to do them you need to write some BASIC code.
Each house on Disco Street has an address number, just like any other house in your town. Except that on Disco Street, each house number has a corresponding line of computer code, like this:
10 REM HOUSE #10
20 REM HOUSE #20
and so forth.
(REM, by the way, means REMark — the computer ignores the remark that comes after it, because it’s only there for humans to read.)
We’re going to start by visiting house number 1, and see what we can do to earn some DiscoMoney!
But first, we need to get set up. Start DiscoRunner, and once you get the ] prompt (which is how the computer asks for instructions) type NEW and press the ENTER key. This empties out DiscoRunner’s memory and lets us start with a blank slate.
Let’s go to house 1!
Mister Bits answers the door. “I’d like you to PRINT out a message for Mrs. Bits wishing her a happy birthday.”
The PRINT command (called a command because it commands the computer to do something) displays whatever comes after it on the screen. In this case, since we only want it to PRINT one specific thing (known as static text), we can just put the message in double-quotes. Because it’s house 1’s request we start with the number 1.
Enter:
1 PRINT “Happy Birthday Mrs. Bits!”
If you type RUN and press ENTER you should see:
Happy Birthday Mrs. Bits!
Good job! Mister Bits is happy, and wants to give you a DiscoDollar. However, you have no place to put it! You need to create a container to hold it. In BASIC, these containers are called variables.
In this case, we need a variable that will count how many DiscoDollars we have. It only needs to store a single number. In BASIC, all we need to do to store a single number is to choose a name for our variable, and declare that it has a value.
Variable names can use the letters A to Z. Let’s call our variable MONEY. To create our variable we simply declare that MONEY has a value of 1. We can do this using the LET command:
LET MONEY = 1
Now, the PRINT command can also show us the value (or contents) of a variable. So, if we want to see how much money we have, we can type PRINT MONEY and press the ENTER key.
PRINT MONEY
1
Hooray! We have a dollar! But there are many things that could cause that variable to be ‘erased’ and so we should make it a little more permanent. Since we earned that dollar doing something for house 1, we should place our declaration on the end of house 1’s line, separating our commands with a colon. It should look like this:
1 PRINT “Happy Birthday Mrs. Bits!” : LET MONEY = 1
Now when we RUN our money-earning program, we will see:
Happy Birthday Mrs. Bits!
But what about our money? It’s there! To see it, type:
PRINT MONEY
1
Maybe it would be better to have our program tell us how much money we have when we RUN it, so we don’t have to type PRINT MONEY every time. Let’s add another line.
There are 100 houses on Disco Street, so let’s leave lines 1 to 100 for them, and add our line at 101. Type:
101 PRINT MONEY
Now, if we RUN our program we’ll see:
Happy Birthday Mrs. Bits!
1
Admittedly, although we can see how much money we have, it’s a little ambiguous. Someone who didn’t know it was money wouldn’t know what it was! “One? One what?”
We can fix that, though. The PRINT command lets you mix static text and variables using the semicolon, like this:
PRINT “I have “; MONEY ;” dollars.”
I have 1 dollars.
That’s much better! So, let’s replace line 101 with our more precise version.
101 PRINT “I have”; MONEY ;”dollars.”
Now, to see what our program looks like, we use the LIST command.
LIST
1 PRINT “Happy Birthday Mrs. Bits!” : LET MONEY = 1
101 PRINT “I have”; MONEY ;”dollars.”
Looking good! So far we’ve learned how to PRINT and LET. Great job! Time to move on to house number 2.
Miss Sprite answers the door at house number 2. “I’d like you to take a Pi to Miss Pixel at house number 20. Once you’ve taken it there, PRINT it for her, and then come back and I’ll give you another dollar.”
Pi is a mathematical value that has something to do with circles. For our purposes we will say that Pi has a value of 3.14. So, to do what Miss Sprite is asking, we must declare a variable named PI with a value of 3.14, then go to house number 20, PRINT it, then RETURN to house 2. Our line will start out:
2 LET PI = 3.14
But now what? How do we get to house number 20? Do we GO TO 20? No! We’ll get around to GOTO a bit later, but in this case, because we need to come back to house number 2, we’ll use a command specially designed for this task, called GOSUB.
2 LET PI = 3.14 : GOSUB 20
Good. So, the “program counter”, a special variable that keeps track of what command to RUN next, will advance to line 20. The code at line 20 is called a “subroutine” because we expect to RETURN from it.
Now we need to tell the program what to do when it jumps to the subroutine. Miss Sprite wanted us to PRINT PI for her:
20 PRINT PI
and then RETURN to her house.
20 PRINT PI : RETURN
So, now the program counter will RETURN back to right after the GOSUB command, where Miss Pixel will give us another dollar. We need to add that dollar to our MONEY.
2 LET PI = 3.14 : GOSUB 20 : LET MONEY = MONEY + 1
See what we did there? You can do simple equations with LET. So, we’re adding one to whatever value MONEY already is! Cool, huh? Let’s have a look at our program.
1 PRINT “Happy Birthday Mrs. Bits!” : LET MONEY = 1
2 LET PI = 3.14 : GOSUB 20 : LET MONEY = MONEY + 1
20 PRINT PI : RETURN
101 PRINT “I have”; MONEY ;”dollars.”
However, we’ve created a problem. If we RUN our program now, something bad will happen!
RUN
Happy Birthday Mrs. Bits
3.14
3.14
?RETURN WITHOUT GOSUB ERROR AT LINE 20
What’s going on? The computer didn’t like that! How do we fix it?
Well, what happened was the program counter went to house 1, then house 2, then house 20, then back to house 2, but then went back to house 20 a second time because it was the next house after 2 with any code. When it got there, it delivered the Pi again, but then was told to RETURN but didn’t know where to RETURN to! So it got confused and gave up.
There are a few ways we can solve this problem, and still get to line 101 to tell us how much money we have. One is to put a “note” at house 19 to skip house 20 and GOTO house 21.
19 GOTO 21
RUN
Happy Birthday Mrs. Bits
3.14
?LINE DOES NOT EXIST (21) AT LINE 19
Uh oh. The program counter still got confused, because we specifically told it to go to house 21, but there was nothing at house 21 for it to do. We can solve this problem though by putting a REMark at line 21. It won’t actually do anything, but the program counter won’t get lost if we do.
21 REM So the program counter doesn’t get lost.
Let’s have a look.
LIST
1 PRINT “Happy Birthday Mrs. Bits!” : LET MONEY = 1
2 LET PI = 3.14 : GOSUB 20 : LET MONEY = MONEY + 1
19 GOTO 21
20 PRINT PI : RETURN
21 REM So the program counter doesn’t get lost.
101 PRINT “I have”; MONEY ;”dollars.”
Looks good! Let’s RUN it.
RUN
Happy Birthday Mrs. Bits
3.14
I have 2 dollars.
Hooray! We have two hard-earned dollars in our MONEY. Now, let’s try for a third.
House number 3 is answered by a small boy, named Rom. He wants us to help him learn how to count from one to ten, in exchange for his allowance, a dollar. To do this he wants us to PRINT the numbers. We could do this by simply going:
PRINT “1 2 3 4 5 6 7 8 9 10″
but Rom says no. He wants each number on a separate line, like
1
2
3
etc.
Well, we can’t really do that in a print statement like that. We could have ten PRINT statements, each printing out a number, but Rom insults our intelligence when we suggest that. He wants us to teach him how to count, not just PRINT; he already knows how to do that!
Remember our MONEY variable? Maybe we could do something like that. Maybe we could create another variable, then add one to it, then PRINT the variable, add another one, and so forth. Let’s call the variable COUNT, and give it its first value of 1.
3 LET COUNT = 1
Okay, so now we need to PRINT it, then add 1, then PRINT it again.
3 LET COUNT = 1 : PRINT COUNT : LET COUNT = COUNT + 1 : PRINT COUNT
Rom stops us there. While we could just keep adding one and PRINTing COUNT until we got to 10, this isn’t what he wants. Rom wants us to use something called a ‘loop’, to repeat a sequence of commands over and over.
What we can do is make a loop using GOTO that will keep adding 1 to COUNT and printing it. Something like:
3 LET COUNT = 1 : PRINT COUNT : LET COUNT = COUNT + 1 : GOTO 3
Except that this won’t work! Every time line 3 executes COUNT will always be 1, because we will keep re-declaring COUNT to be 1 at the start of the line! We need more lines. Maybe we can ‘borrow’ line 4. Surely whoever lives at house number 4 won’t mind?
3 LET COUNT = 1
4 PRINT COUNT : LET COUNT = COUNT + 1 : GOTO 4
This will work — sort of. It will count from one to ten, then to a hundred, then to a thousand, on to infinity (almost!) Rom is upset. This is not what he wants. He only wants the numbers from 1 to 10! We need a way to stop at ten.
BASIC has a way of making a decision. It’s known as a conditional, and in BASIC it takes the form of an IF THEN statement. In the case of our current task, we can use IF THEN to stop counting once we get to 10.
4 PRINT COUNT : LET COUNT = COUT + 1 : IF COUNT < 10 THEN GOTO 4
< means “less than” (you can also use > “greater than” and = “equals”). So, what we’re telling the computer to do here is, “If COUNT is less than 10, IF this is true THEN do line 4 again.”
Let’s RUN our program and see what happens.
Happy Birthday Mrs. Bits
3.14
1
2
3
4
5
6
7
8
9
I have 2 dollars.
Rom has a tantrum. Where’s number 10? He screams! He wants number 10!
Let’s look at line 4 again.
4 PRINT COUNT : LET COUNT = COUNT + 1 : IF COUNT < 10 THEN GOTO 4
Can you spot what’s wrong? We’re adding one to COUNT after we PRINT it, then checking if COUNT is 10! So 10 never gets printed. We can fix it by increasing our comparison in the IF THEN statement by one, so we end up with:
4 PRINT COUNT : LET COUNT = COUNT + 1 : IF COUNT < 11 THEN GOTO 4
Hurray! Problem solved. Rom is happy, and he gives us a dollar. Let’s add one to our MONEY at the end of line 4.
4 PRINT COUNT : LET COUNT = COUNT + 1 : IF COUNT < 11 THEN GOTO 4 : LET MONEY = MONEY + 1
Now we RUN it.
Happy Birthday Mrs. Bits
3.14
1
2
3
4
5
6
7
8
9
10
I have 2 dollars.
What? Where’s our money? We did a lot for that dollar! What happened to it?
Well, it turns out that (in Applesoft and many other BASICs) commands after an IF THEN only execute if the IF THEN statement is true, and of course it’s not true because if it was we would return back to the start of line 4 and keep counting. So we never add 1 to our MONEY. The computer simply ignores that LET statement, as if it doesn’t exist.
We need to put it on another line. Hopefully house number 5 doesn’t mind.
4 PRINT COUNT : LET COUNT = COUNT + 1 : IF COUNT < 11 THEN GOTO 4
5 MONEY = MONEY + 1
Let’s RUN our program again.
RUN
Happy Birthday Mrs. Bits
3.14
1
2
3
4
5
6
7
8
9
10
I have 3 dollars.
Feels good to get paid, doesn’t it? But we’ve used up lines 5 and 6 to do it, and house number 5 is big and looks expensive. There’s surely money to be made there. Maybe we could carry on two lines ahead?
Professor Syntax answers the door at number 5. He looks at your program and shakes his head. “I have plenty for you to do, and I’ll even pay you three dollars to do it, but I won’t have you do it on line 7. Fix your program and come back.” He shuts the door.
What can we do? Three dollars would double our money! Hm. Maybe there’s a way we can get more lines? Let’s try something.
First, we’ll invoke the program editor. Type EDIT and press ENTER.
The editor should open, and we will see our program in it. We can use the cursor keys to move around the editor. What we want to do is add a 0 to each line number. This will give us ten times as many lines to work with! So move the cursor to line 1 and add a 0 to it, so it looks like:
10 PRINT “Happy Birthday Mrs. Bits!” : LET MONEY = 1
Now do the same thing to the rest of the lines: 2 should be 20, 3 should be 30 and so forth. Once you’re done, we also need to change any jumps we made in the program: GOTO and GOSUB statements. Add a 0 to the end of the line numbers specified in those.
You should end up with:
10 PRINT “Happy Birthday Mrs. Bits!” : LET MONEY = 1
20 LET PI = 3.14 : GOSUB 200 : LET MONEY = MONEY + 1
30 LET COUNT = 1
40 PRINT COUNT : LET COUNT = COUNT + 1 : IF COUNT < 11 THEN GOTO 40
50 MONEY = MONEY + 1
190 GOTO 210
200 PRINT PI : RETURN
210 REM So the program counter doesn’t get lost.
1010 PRINT “I have”; MONEY ;”dollars.”
Press F2 to keep our changes and exit the editor. RUN the program and make sure it’s okay, and if not, go back into the editor and see what’s wrong.
We knock on Professor Syntax’s door again. “Good! You’ve created more space to work in, but if I’m not mistaken, my line is now line 40, and it still has things in it!” He closes the door again.
We can fix this. Now that we have all those extra line numbers, we can take the stuff on lines 40 and 50 and put them on lines 31 and 32. Return to the editor (by typing EDIT and pressing the ENTER key) and modify the program so it looks like this:
10 PRINT “Happy Birthday Mrs. Bits!” : LET MONEY = 1
20 LET PI = 3.14 : GOSUB 200 : LET MONEY = MONEY + 1
30 LET COUNT = 1
31 PRINT COUNT : LET COUNT = COUNT + 1 : IF COUNT < 11 THEN GOTO 31
32 MONEY = MONEY + 1
190 GOTO 210
200 PRINT PI : RETURN
210 REM So the program counter doesn’t get lost.
1010 PRINT “I have”; MONEY ;”dollars.”
Don’t forget to change the IF THEN statement at the end of line 31 (formerly line 40) to say GOTO 31 or otherwise bad things will happen!
We darken Professor Syntax’s door again for the third time, and third time’s the charm. “Your code’s not perfect, but it will do. Come on in!”
“This house has three floors and I have some boxes on each floor of this house. I need them moved from one floor to another. I want you to take three boxes from floor 1 to floor 2, then take 3 boxes from floor 3 to floor 2. There will be 3 boxes on floor 2 to start with, so in total there should be 9 boxes on floor 2 when you’re done.”
The boxes, and the floor each one is on is expressed as something called an array. An array is a variable that has multiple values inside of it. In this case, the array is called BOXES. To see what floor box 1 is on, we need to look at BOXES, but we also need to specify the index of box 1 (which is 1) in brackets.
PRINT BOXES(1)
0
What? Box 1 is on floor 0? But there is no floor 0! Well, we haven’t actually assigned the boxes yet. We need to create the boxes in our program before we can move them around. But first, there’s a little housekeeping we need to do.
Whenever you want to use an array in a program, you should (must) DIMension it. The DIM statement tells the computer how many ‘slots’ of memory to allocate to the array. So firstly we need to DIMension BOXES with a value of 9.
40 DIM BOXES(9)
Good. Now we need to specify which floor each box is currently on. Boxes 1 to 3 are on floor 1, 4 to 6 are on floor 2 and 7 to 9 are on floor 3.
41 LET BOXES(1) = 1 : LET BOXES(2) = 1 : LET BOXES(3) = 1
Professor Syntax stops you right there. “That’s not very efficient. Use loops.”
Hm. Well, there doesn’t seem to be a way to use GOTO or IF THEN to solve our problem, but there is another way, a new type of loop called a FOR NEXT loop. Let’s see what that looks like and then I’ll explain it:
41 FOR COUNT = 1 TO 3 : LET BOXES(COUNT) = 1 : NEXT COUNT
It’s okay to re-use the COUNT variable because we don’t need it anymore for Rom’s lesson, that’s finished. So we’re going to use it here. FOR NEXT is not as straightforward as IF THEN, there’s a little voodoo magic going on here but I’ll do my best to explain what’s going on.
FOR COUNT = 1 TO 3 tells the computer that we want to assign a value of between 1 and 3 to COUNT, starting at 1 and ending with 3. Once that value is assigned, LET BOXES(COUNT) = 1 puts the number 1 into BOXES(COUNT). COUNT to start with is 1, so we’re placing the value 1 into BOXES(1).
Finally, by saying NEXT COUNT we’re telling the computer to go back to the FOR COUNT statement, increase COUNT by 1, and then execute the LET BOXES statement again, with the new COUNT value (in this case 2) setting the value of BOXES(2) to 1.
It loops one more time, then when we reach the NEXT statement for the third time, the computer decides there’s no more numbers left to do, and the program carries on from there.
So we’ve assigned the floor value to three boxes. But there are six more boxes to do. We could do this:
42 FOR COUNT = 4 TO 6 : LET BOXES(COUNT) = 2 : NEXT COUNT
and similar for boxes 7 to 9, however Professor Syntax is unhappy with that. “Use nesting”, he says.
Oh, all these people are so picky! What’s nesting? I’m not a bird! After a while we come up with this:
41 FOR NEST = 1 TO 3 : FOR COUNT = NEST * 3 – 2 TO NEST * 3 : BOXES(COUNT) = NEST : NEXT COUNT : NEXT NEST
First, there’s a FOR NEXT loop inside another FOR NEXT loop! Kinda weird, huh? The second FOR NEXT loop, COUNT, relies on the value of the first FOR NEXT loop, NEST, to calculate each box number, with a little bit of slightly tricky math. COUNT also uses NEST as the floor number to assign to BOXES.
See if you can follow along. Write down the values of NEST and COUNT, starting with NEST as 1, solving the math to determine COUNT, then going through the loops until they’re finished. See how that works? Cool, huh?
Let’s change line 41 to show us COUNT as it executes (use EDIT if you like) and then add a new command, STOP to the end of the line:
41 FOR NEST = 1 TO 3 : FOR COUNT = NEST * 3 – 2 TO NEST * 3 : PRINT COUNT : BOXES(COUNT) = NEST : NEXT COUNT : NEXT NEST : STOP
Exit the editor with F2 (if you used it) and then let’s execute just line 41, by typing GOTO 41 at the ] prompt and pressing ENTER.
1
2
3
4
5
6
7
8
9
?BREAK AT LINE 41
Great! Go back into EDIT and remove the STOP statement, then press F2 to keep your changes and return to the command prompt. Let’s see if the floor values were assigned to the boxes properly.
PRINT BOXES(2)
1
PRINT BOXES(8)
3
Looks good! So, now we just have to re-assign all the BOXES to 2. We can do that with another FOR NEXT loop:
42 FOR COUNT = 1 TO 9 : BOXES (COUNT) = 2 : NEXT COUNT
And we’re done! We’ve “moved” all of the boxes to the second floor. Professor Syntax is happy and gives us three dollars. Let’s add them to our MONEY:
43 MONEY = MONEY + 3
Now, let’s RUN our program:
Happy Birthday Mrs. Bits
3.14
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
I have 6 dollars.
Wow! Six dollars! Starting to get a bit tired though, so let’s do one more house and then call it a day, shall we? Knocking on the door of house number 5.
Mrs. Silicon answers. “Glad you’re here. I need you to take a telegram to Doctor Chip, at house number 15, then come back and take a second telegram to Mrs. Circuit at house 12. I’ll give you 4 dollars if you can do it quickly.”
“The message for Doctor Chip reads, ‘Cannot make my appointment today, will reschedule’ and the message for Mrs. Circuit says ‘Can we please have tea at 4pm?’. You must store these into variables, go to their houses and PRINT the messages for them to see. Hurry!”
Sounds pretty straight forward, nothing we haven’t done already. First, we’ll just assign the message for Doctor Chip into a variable called TELEGRAM
50 LET TELEGRAM = “Cannot make my appointment today, will reschedule”
Now RUN the program. You got an error, didn’t you? The reason for this is the computer thinks TELEGRAM is a number. Trying to assign a string of letters to TELEGRAM causes the computer to become confused. We need to tell the computer that TELEGRAM is a string, and we do this by putting a dollar sign at the end of the variable name:
50 LET TELEGRAM$ = “Cannot make my appointment today, will reschedule”
All good now! So let’s deliver the message to house 15. Remember, house 15’s line number is 150.
51 GOSUB 150
150 PRINT TELEGRAM$ : RETURN
Let’s deliver the next message. First we assign it to TELEGRAM$, then GOSUB house 12 (line 120) and return.
52 LET TELEGRAM$ = “Can we please have tea at 4pm?” : GOSUB 120
120 PRINT TELEGRAM$ : RETURN
But wait. Mrs Circuit has a reply. So we’ll store that back into TELEGRAM$ and PRINT it for Mrs. Silicon.
120 PRINT TELEGRAM$ : LET TELEGRAM$ = “Yes, of course, see you at 4pm” : RETURN
53 PRINT TELEGRAM$
Let’s RUN our program and deliver those messages!
Happy Birthday Mrs. Bits
3.14
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
Cannot make my appointment today, will reschedule
Can we please have tea at 4pm?
Yes, of course, see you at 4pm
Yes, of course, see you at 4pm
?RETURN WITHOUT GOSUB ERROR AT LINE 120
Uh oh. The program counter has gone to house 12 twice! But this is our last house of the day, so rather than re-direct around house 12 like we did with house 20, we’ll just use GOTO to skip to line 1010 (GOTO not GOSUB because we don’t plan on coming back), where we see how much MONEY we’ve made.
54 GOTO 1010
It all seems good now, but we haven’t been paid by Mrs. Silicon, so we still only have 6 dollars! She gives you 4 dollars to put into your MONEY. Let’s change line 54:
54 LET MONEY = MONEY + 4 : GOTO 1010
Now when you RUN the program the last line output should be:
I have 10 dollars.
That’s a good day’s work! Let’s see what our program looks like:
LIST
10 PRINT “Happy Birthday Mrs. Bits!” : LET MONEY = 1
20 LET PI = 3.14 : GOSUB 200 : LET MONEY = MONEY + 1
30 LET COUNT = 1
31 PRINT COUNT : LET COUNT = COUNT + 1 : IF COUNT < 11 THEN GOTO 31
32 MONEY = MONEY + 1
40 DIM BOXES(9)
41 FOR NEST = 1 TO 3 : FOR COUNT = NEST * 3 – 2 TO NEST * 3 : PRINT COUNT : BOXES(COUNT) = NEST : NEXT COUNT : NEXT NEST
42 FOR COUNT = 1 TO 9 : BOXES (COUNT) = 2 : NEXT COUNT
43 MONEY = MONEY + 3
50 LET TELEGRAM$ = “Cannot make my appointment today, will reschedule”
51 GOSUB 150
52 LET TELEGRAM$ = “Can we please have tea at 4pm?” : GOSUB 120
53 PRINT TELEGRAM$
54 LET MONEY = MONEY + 4 : GOTO 1010
120 PRINT TELEGRAM$ : LET TELEGRAM$ = “Yes, of course, see you at 4pm” : RETURN
150 PRINT TELEGRAM$ : RETURN
190 GOTO 210
200 PRINT PI : RETURN
210 REM So the program counter doesn’t get lost.
1010 PRINT “I have”; MONEY ;”dollars.”
A couple final things before we wrap things up: first we should terminate our program with the command END (it’s not necessary but it’s polite. Also there could be more lines after where we want to stop, for example other subroutines). Add:
1020 END
Also, since we no longer encounter line 200 twice because of our final GOTO to our MONEY count, we can get rid of lines 190 and 210 (remember why we put them there? See why we don’t need them anymore?)
Our final program should look like this:
LIST
10 PRINT “Happy Birthday Mrs. Bits!” : LET MONEY = 1
20 LET PI = 3.14 : GOSUB 200 : LET MONEY = MONEY + 1
30 LET COUNT = 1
31 PRINT COUNT : LET COUNT = COUNT + 1 : IF COUNT < 11 THEN GOTO 31
32 MONEY = MONEY + 1
40 DIM BOXES(9)
41 FOR NEST = 1 TO 3 : FOR COUNT = NEST * 3 – 2 TO NEST * 3 : PRINT COUNT : BOXES(COUNT) = NEST : NEXT COUNT : NEXT NEST
42 FOR COUNT = 1 TO 9 : BOXES (COUNT) = 2 : NEXT COUNT
43 MONEY = MONEY + 3
50 LET TELEGRAM$ = “Cannot make my appointment today, will reschedule”
51 GOSUB 150
52 LET TELEGRAM$ = “Can we please have tea at 4pm?” : GOSUB 120
53 PRINT TELEGRAM$
54 LET MONEY = MONEY + 4 : GOTO 1010
120 PRINT TELEGRAM$ : LET TELEGRAM$ = “Yes, of course, see you at 4pm” : RETURN
150 PRINT TELEGRAM$ : RETURN
200 PRINT PI : RETURN
1010 PRINT “I have”; MONEY ;”dollars.”
1020 END
Hope you’ve learned a fair bit about BASIC today, and we’ll see you next time, when we’ll continue our door-knocking on Disco Street, and dive into the colourful world of GRAPHICS!




