Everything I Needed to Know About Programming I Learned from BASIC

the key controllers reminds me of a hp?8 calculator ^^ ( which is lisp enabled , something i didnt understood until 10 years after buying it _ )

REAL programmers use: COPY CON PROGRM.EXE

But seriously, I have lobg felt that the biggest disservice that Microsoft did to professional VB programmers was to promote VB as easy. That brought out the folks who didn’t know how to anything but plop down controls wire them up (and that badly).

I played around with BASIC in high school on a PDP-11, then didn’t do much with computers 'til years later. Started the mainframe program at a trade school with BASIC on Commodore Pets, then moved over to the IBM System/360 for COBOL, Assembler (fun!) and RPG (yes, there is at least one BAD language…). A few years in ops, then more in restaurants before I came back to software with VB 3. Skipped 4, worked extensively in 5 6. Now I’m getting my feet wet with VB.NET and following along in C#. All versions of VB with which I’ve worked have been fine languages (for their time) IF you had the conceptual framework with which to build a proper structured (not necessarily Structured) program.

How far the discussion has gone! The point was that BASIC isn’t the goto hell language as some have suggested. Sure the home computers back in the day had limited capability, and the need for a programming language to make them accessible was dire; thus BASIC was what was best for the job. Any evils for spaghetti code done in the way are way compensated by the availability for young people to actually code on a machine.

Sure some people who weren’t serious about it in the first place write spaghetti code today, but that’s hardly because BASIC was their first language, it’s because they’re lazy. The 1980s home computer revolution was the forerunner of todays computer in every home. I did learn the wrong way of programming with Commodore 64 Basic, but I learned not to do the goto hell stuff pretty quick.

Clarification for my previous comment: I quickly learned to use subroutines for doing all the stuff that is done again and again, and the spaghettification (i.e. goto statements) went to the minimum. My programming on the Commodore 64 tended towards object oriented stuff. Using kernel (OS) calls was a must to do any real stuff too.

I gotta end my comment spree with an anecdote:

My first program when I was about 6 years old consisted of print and end statements, in the style 10 print If you want to do this, type run 50 etc. I tried to save the program on tape. My elder brother whose computer I was programming on came to help me to troubleshoot why the program wouldn’t load again. He finally asked did I press the record button together with the play button on the Datasette. I was embarrassed. And he said user error. User error is still the culprit in most problems. :slight_smile:

you can still make basic stuff in Liberty Basic, and do awesome things like cut paste copy you couldn’t do before. I use to make all kinds of tiny role-playing games, i don’t know why, but i made another one on the link above and am finishing up another one to put up soon as well. those 2 books stuck out in my head instantly, i had totally forgotten about them, i used to program basic on a TI-99 with those books. one of the programs that i still remember was a virtual psychiatrist named Liza i think, she would ask you all kinds of questions and what you answered would move her on to the next question. There were also some huge programs that were fun (hunt the wumpus?). anyways thanks for the memory rehash! =)

I’m not sure what’s up with the VB6 bashers. Sure many dreaded Morts learned from it and continue to be coding monkeys because of it, but it was one of the best options during its time, just like BASIC was during the early 80s (well, BASIC was the only option then come to think of it).

Thing is, a programmer wallowing in Visual Basic 6 and deciding to step up and do serious learning of things like OOP and functional programming and TDD and the rest of the agile stuff is ema conscious effort by the person/em, not a limitation set by VB6. I came down that path, and I do not have a CS degree, and I can say that today I have a fair understanding of some of the above concepts.

Again, if anything, emit’s the people who refuse to learn/em that is the problem, not the tools.

You certainly won’t blame an nail gun if your carpenter doesn’t want to use hammers anymore, would you?

To the kid wanting to start programming:

DO NOT TAKE UP ANY FORM OF BASIC, VISUAL OR OTHERWISE. If you want something less complex and hardcore than C/C++ to start with, and want to learn a popular general purpose language, look to Java, C# (pronounced “C-sharp”), or Python. If you are mostly interested in web applications, look at PHP, Python, or Ruby. Again, AVOID visual basic at all costs.

I saved my pocket money for four months to buy Blitz Basic for the Amiga.

Basic started my programming career and like you, I am appreciative of the fact it was the first language I wrote.

Thanks for giving Basic a much needed shout-out.

Simon

I remember going to the library to photocopy ‘Compute!’ magazine listings, featuring cool BASIC games like “Roadar” (a racing game) and “Worms” (nibbles in Quickbasic). I also have a children’s book called “Island of Secrets”, which has a complete BASIC listing of an adventure game. I remember well the exhausting task of typing those listings into the computer and the pleasure of typing run and playing a real game.

And you know what? If it wasn’t for the nostalgia, we’d all be saying what an abomination this BASIC is. It’s next to impossible to learn anything at all from those listings. I just got out my copy of “Island of Secrets”, and it’s utter gibberish. Even more than Perl, traditional BASIC is a write-only language – at least the way real BASIC programs were written. I certainly learnt nothing about programming from early exposure to BASIC. Indeed, it was almost child abuse. Tell a kid he can write real programs with his computer, and then watch him struggle vainly to reimplement “Buck Rogers” in a language that is barely worthy to implement “Hello World.” The most typing in BASIC listings ever did for me was slighly improve my transcribing skills.

Things are just better now. Like blatant sexist advertising, glam metal, flickering low-resolution green text-mode terminals, and office workers chain smoking at their desks all day long, BASIC is one of those things that deserves to be consigned to the dark ages of the eighties where it belongs.

Rhywun:

If I were to teach kids programming today I would skip all of those and start with Smalltalk. It’s not terribly “useful” in today’s business world but it’s a wonderful way to learn programming.

Try Python. It’s not quite as beautiful or pure in concept as Smalltalk, but it’s Smalltalk’s legitimate heir, and a real working language with lots of libraries and a big community behind it (so you can get real work done with it.)

(In fact, Python, Smalltalk and probably Lisp are the only languages I can think of that I would classify as “not child abuse” if taught as first languages in primary/secondary school. Smalltalk was of course initially designed for use by children. Granted, extraordinarily bright children, but children nonetheless.)

5 REM FIZZBUZZ IN C64 BASIC BY JASON STOKES
10 FOR I = 1 TO 100
20 GOSUB 100
30 IF D3 = -1 AND D5 = -1 THEN PRINT "FIZZBUZZ": GOTO 70
40 IF D3 = -1 THEN PRINT "FIZZ": GOTO 70
50 IF D5 = -1 THEN PRINT "BUZZ": GOTO 70
60 PRINT I
70 NEXT I
80 END
100 IF I - (INT(I / 5) * 5) = 0 THEN D5 = -1: GOTO 120
110 D5 = 0
120 IF I - (INT(I / 3) * 3) = 0 THEN D3 = -1: GOTO 140
130 D3 = 0
140 RETURN

Man, was that hard. I’d forgotten so many gory details about the language. Like how there’s only an IF construct, not an IF… ELSE construct. Oh, and in C64 BASIC variable names are only significant to the second character, so CO, COL and COLUMN are the same variable.
The apparent lack of a modulo division operator or function threw me for a while, but I improvised with a GOSUB - which, in true BASIC fashion, communicates via global variables, since there are no function arguments in BASIC – unless you want to use DEF FN, and who the hell ever did that? Not to mention that if we declare I to be of integer type (done with I%) we can’t use it in a FOR construct – and since variables are stored internally as floats and converted for integer arithmetic, an integer in C64 BASIC is actually slower than a FLOAT anyway.
There’s no booleans either – apparently the convention is to use -1 (hex FFFF) for TRUE, and 0 for FALSE.
That brought back a lot of memories. Painful ones.

Atari 800XL, how I loved thee.

Your BASIC, I loved to program, but nowhere could I save you!

You were so volatile.

And then we got that shoe-box sized 5 1/4" external disk drive. Though, at the age of 7, I still don’t think I figured out how to save to you. At least I could program beeping musics and flashing, techni-color screens!

Ah, those were the days :slight_smile:

Now I feel OLD. I started on a PET 2001 (it is in my basement, and may be headed for Digibarn.) I agree that there are some constructs in BASIC that are bad, but that is with any language. You could even say that Pascal was designed for academia, and never should have left, but in the end, it is the programmer, not the language.

It also surprises me how many started about the same age I did, 6. Maybe that is the real key, not the language, but getting started, and thinking logically very early.

My first was a Heathkit H-8 (Intel 8008 processor). I had to build it before I could program it. My first programs were entered in octal machine code from the front panel keypad until I could afford a serial I/O card kit. I finally got it up to a whopping 24K of memory.

I miss Heathkit. I built radios, stereos, walkie-talkies, and test equipment besides the computer. I think the company is still around, but they do continuing education now, rather than hardware.

Oh wow - flashback. I had an Atari 800 (the one with the keyboard), and my mom used to program games for me on it. I was 6 - not quite at the level to start programming myself, although I could write simple programs. At any rate, there was no way to save them (except for a tape drive you had to buy separately), so you pretty much could play with your programmed game until you had to turn off the console - then goodbye cool game!

Anyway, I always think that I had a way-cool mom for that reason. She’s not even a software engineer, so extra credit for being a marketing manager and learning to program games on an atari 800 for your kid.

Several commenters have brought up the question of how to best go about introducing a young child to computer programming in this modern day and age. Jeff, I’d love to see you address that question sometime.

And yes, a “me too”: I started programming at age 5 or 6 on an IBM PC 5150 that my Dad brought home from his job at IBM. Like the Apple, Commodore, and Atari machines of the era, it booted to a BASIC programming environment if you turned on the machine with no diskette in the A: drive!

I remember that the SAVE and LOAD commands (for saving your program to a diskette, and loading it back later) would only work if you started BASIC by booting to a DOS diskette and then running BASIC (or BASICA – both were available) from that!

At least GOTO doesn’t let you jump to a location that is outside your program or doesn’t contain an instruction. Infinitely more damage has been done by improperly used strcpy() and pointer arithmetic than by GOTO.

Sorry to dredge up the old post, but I really enjoyed your article and the images of the old school keyboard controllers. Those are crazy.

I remember the hour upon hours of programming I did on the old Apple computers (in addition to playing billions of hours of games). It is amazing to think back of the progression from playing and programming dinky little games to what we do today. I run a really old school, online text game company - http://www.ironrealms.com - but it is still the same old thing, hours of endless fun playing games, and coding games.

Wouldn’t trade it for the world.

1 Like

Well, Turbo Pascal is still alive!

And I also started with ZX Spectrum and Basic. Those were the times…

1 Like

There was a 40th anniversary edition of Basic Computer Games, which apparently was updated to use Microsoft Small Basic?

They even updated the cover :heart_eyes:

Here’s an updated classic game from the book:

Civil War was written in 1968 by three Students at Lexington High School, Massachusetts: L Cram, L. Goodie, and D. Hibbard. It was modified into a 2-player game by G. Paul and R. Hess of TIES, St. Paul, Minnesota. It was ported to Microsoft Small Basic by BIBLEBYTE BOOKS in 2010.

On the left, the updated 2010 version, on the right, the 1973 original:

I have to say the rewrite is … kinda worse… than the original? Judge for yourself:

As I guessed, MS Small Basic is basically a re-skinned vb.net?

As you’d expect, most of it is public on GitHub.

1 Like

Turns out, Phil Conrod ported Hunt the Wumpus to MS Small Basic – I didn’t even realize I had this in my email from 10 years ago!

' *** HUNT THE WUMPUS ***
' By Gregory Yob
' Ported to Microsoft Small Basic by ComputerScienceForKids.com
'
TextWindow
.Write("INSTRUCTIONS (Y-N)? ")
IS = TextWindow.Read()
If
IS="N" Or IS="n" Then
GOTO LN35
EndIf
Sub375()
LN35:
' *** SET UP CAVE (DODECAHEDRAL NODE LIST) ***
SA[1][1] = 2
SA[1][2] = 5
SA[1][3] = 8
SA[2][1] = 1
SA[2][2] = 3
SA[2][3] = 10
SA[3][1] = 2
SA[3][2] = 4
SA[3][3] = 12
SA[4][1] = 3
SA[4][2] = 5
SA[4][3] = 14
SA[5][1] = 1
SA[5][2] = 4
SA[5][3] = 6
SA[6][1] = 5
SA[6][2] = 7
SA[6][3] = 15
SA[7][1] = 6
SA[7][2] = 8
SA[7][3] = 17
SA[8][1] = 1
SA[8][2] = 7
SA[8][3] = 9
SA[9][1] = 8
SA[9][2] = 10
SA[9][3] = 18
SA[10][1] = 2
SA[10][2] = 9
SA[10][3] = 11
SA[11][1] = 10
SA[11][2] = 12
SA[11][3] = 19
SA[12][1] = 3
SA[12][2] = 11
SA[12][3] = 13
SA[13][1] = 12
SA[13][2] = 14
SA[13][3] = 20
SA[14][1] = 4
SA[14][2] = 13
SA[14][3] = 15
SA[15][1] = 6
SA[15][2] = 14
SA[15][3] = 16
SA[16][1] = 15
SA[16][2] = 17
SA[16][3] = 20
SA[17][1] = 7
SA[17][2] = 16
SA[17][3] = 18
SA[18][1] = 9
SA[18][2] = 17
SA[18][3] = 19
SA[19][1] = 11
SA[19][2] = 18
SA[19][3] = 20
SA[20][1] = 13
SA[20][2] = 16
SA[20][3] = 19
' *** LOCATE LA ARRAY ITEMS ***
' *** 1-YOU, 2-WUMPUS, 3&4-PITS, 5&6-BATS ***
LN170:
TextWindow
.WriteLine("")
TextWindow
.WriteLine("SETTING UP MAZE. PLEASE WAIT.")
LN171:
For
J=1 To 6
LA[J]=Math.GetRandomNumber(20)
MA[J]=LA[J]
EndFor
' *** CHECK FOR CROSSOVERS (IE LA[1]=LA[2], ETC) ***
For
J=1 To 6
For
K=1 To 6
If
J=K Then
GOTO LN215
EndIf
If
LA[J]=LA[K] Then
GOTO LN171
EndIf
LN215:
EndFor
EndFor
' *** SET NO. OF ARROWS ***
LN230:
A=5
L=LA[1]
' *** RUN THE GAME ***
TextWindow
.WriteLine("")
TextWindow
.WriteLine("HUNT THE WUMPUS")
' *** HAZARD WARNING AND LOCATION ***
LN255:
Sub585()
' *** MOVE OR SHOOT ***
Sub670()
If
O=1 Then
GOTO LN280
EndIf
If
O=2 Then
GOTO LN300
EndIf
' *** SHOOT ***
LN280:
Sub715()
If
F=0 Then
GOTO LN255
EndIf
Goto
LN310
' *** MOVE ***
LN300:
Sub975()
If
F=0 Then
GOTO LN255
EndIf
LN310:
If
F>0 Then
GOTO LN335
EndIf
' *** LOSE ***
TextWindow
.WriteLine("HA HA HA - YOU LOSE!")
Goto
LN340
' *** MOVE ***
LN335:
TextWindow
.WriteLine("HEE HEE HEE - THE WUMPUS`LL GET YOU NEXT TIME!!")
LN340:
For
J=1 To 6
LA[J]=MA[J]
EndFor
TextWindow
.Write("SAME SETUP (Y-N)? ")
IS = TextWindow.Read()
If
IS <> "Y" And IS <> "y" Then
GOTO LN170
EndIf
Goto
LN230
Sub
Sub375
' *** INSTRUCTIONS ***
TextWindow
.Clear()
TextWindow
.WriteLine("WELCOME TO HUNT THE WUMPUS")
TextWindow
.WriteLine("")
TextWindow
.WriteLine("THE WUMPUS LIVES IN A CAVE OF 20 ROOMS. EACH ROOM")
TextWindow
.WriteLine("HAS 3 TUNNELS LEADING TO OTHER ROOMS. (LOOK AT A")
TextWindow
.WriteLine("DODECAHEDRON TO SEE HOW THIS WORKS-IF YOU DONT KNOW")
TextWindow
.WriteLine("WHAT A DODECAHEDRON IS, ASK SOMEONE)")
TextWindow
.WriteLine("")
TextWindow
.WriteLine("HAZARDS:")
TextWindow
.WriteLine("")
TextWindow
.WriteLine(" BOTTOMLESS PITS - TWO ROOMS HAVE BOTTOMLESS PITS IN THEM")
TextWindow
.WriteLine(" IF YOU GO THERE, YOU FALL INTO THE PIT (& LOSE!)")
TextWindow
.WriteLine("")
TextWindow
.WriteLine(" SUPER BATS - TWO OTHER ROOMS HAVE SUPER BATS. IF YOU")
TextWindow
.WriteLine(" GO THERE, A BAT GRABS YOU AND TAKES YOU TO SOME OTHER")
TextWindow
.WriteLine(" ROOM AT RANDOM. (WHICH MAY BE TROUBLESOME)")
TextWindow
.WriteLine("")
TextWindow
.Pause()
TextWindow
.Clear()
TextWindow
.WriteLine("WUMPUS:")
TextWindow
.WriteLine("")
TextWindow
.WriteLine(" THE WUMPUS IS NOT BOTHERED BY HAZARDS (HE HAS SUCKER")
TextWindow
.WriteLine(" FEET AND IS TOO BIG FOR A BAT TOO LIFT). USUALLY")
TextWindow
.WriteLine(" HE IS ASLEEP. TWO THINGS WAKE HIM UP: YOU SHOOTING AN")
TextWindow
.WriteLine(" ARROW OR YOU ENTERING HIS ROOM.")
TextWindow
.WriteLine("")
TextWindow
.WriteLine(" IF THE WUMPUS WAKES HE MOVES (P=.75) ONE ROOM")
TextWindow
.WriteLine(" OR STAYS STILL (P=.25). AFTER THAT, IF HE IS WHERE YOU")
TextWindow
.WriteLine(" ARE, HE EATS YOU UP AND YOU LOSE!")
TextWindow
.WriteLine("")
TextWindow
.Pause()
TextWindow
.Clear()
TextWindow
.WriteLine("YOU:")
TextWindow
.WriteLine("")
TextWindow
.WriteLine(" EACH TURN YOU MAY MOVE OR SHOOT A CROOKED ARROW.")
TextWindow
.WriteLine("")
TextWindow
.WriteLine(" MOVING: YOU CAN MOVE ONE ROOM (THRU ONE TUNNEL)")
TextWindow
.WriteLine("")
TextWindow
.WriteLine(" ARROWS: YOU HAVE 5 ARROWS. YOU LOSE WHEN YOU RUN OUT")
TextWindow
.WriteLine(" EACH ARROW CAN GO FROM 1 TO 5 ROOMS. YOU AIM BY TELLING")
TextWindow
.WriteLine(" THE COMPUTER THE ROOM#S YOU WANT THE ARROW TO GO TO.")
TextWindow
.WriteLine(" IF THE ARROW CANT GO THAT WAY (IF NO TUNNEL) IT MOVES")
TextWindow
.WriteLine(" AT RANDOM TO THE NEXT ROOM.")
TextWindow
.WriteLine("")
TextWindow
.WriteLine(" IF THE ARROW HITS THE WUMPUS, YOU WIN.")
TextWindow
.WriteLine(" IF THE ARROW HITS YOU, YOU LOSE.")
TextWindow
.WriteLine("")
TextWindow
.Pause()
TextWindow
.Clear()
TextWindow
.WriteLine("WARNINGS:")
TextWindow
.WriteLine("")
TextWindow
.WriteLine(" WHEN YOU ARE ONE ROOM AWAY FROM A WUMPUS OR HAZARD,")
TextWindow
.WriteLine(" THE COMPUTER SAYS:")
TextWindow
.WriteLine("")
TextWindow
.WriteLine(" WUMPUS: I SMELL A WUMPUS")
TextWindow
.WriteLine(" BAT: BATS NEARBY")
TextWindow
.WriteLine(" PIT: I FEEL A DRAFT")
TextWindow
.WriteLine("")
EndSub
Sub
Sub585
'** PRINT LOCATION & HAZARD WARNINGS ***
TextWindow
.WriteLine("")
For
J=2 To 6
For
K=1 To 3
If
SA[LA[1]][K] <> LA[J] Then
GOTO LN640
EndIf
If
J-1=1 Then
GOTO LN615
EndIf
If
J-1=2 Then
GOTO LN625
EndIf
If
J-1=3 Then
GOTO LN625
EndIf
If
J-1=4 Then
GOTO LN635
EndIf
If
J-1=5 Then
GOTO LN635
EndIf
LN615:
TextWindow
.WriteLine("I SMELL A WUMPUS! ")
Goto
LN640
LN625:
TextWindow
.WriteLine("I FEEL A DRAFT ")
Goto
LN640
LN635:
TextWindow
.WriteLine("BATS NEARBY! ")
LN640:
EndFor
EndFor
TextWindow
.Write("YOU ARE IN ROOM ")
TextWindow
.WriteLine(LA[1])
TextWindow
.Write("TUNNELS LEAD TO ")
TextWindow
.Write(SA[L][1])
TextWindow
.Write(" ")
TextWindow
.Write(SA[L][2])
TextWindow
.Write(" ")
TextWindow
.WriteLine(SA[L][3])
TextWindow
.WriteLine("")
EndSub
Sub
Sub670
' *** CHOOSE OPTION ***
LN675:
TextWindow
.Write("SHOOT OR MOVE (S-M)? ")
IS = TextWindow.Read()
If
IS <> "S" And IS <> "s" Then
GOTO LN700
EndIf
O=1
Goto
ExitSub670
LN700:
If
IS <> "M" And IS <> "m" Then
GOTO LN675
EndIf
O=2
ExitSub670:
EndSub
Sub
Sub715
' *** ARROW ROUTINE ***
F=0
' *** PATH OF ARROW ***
LN735:
TextWindow
.Write("NO. OF ROOMS (1-5)? ")
J9 = TextWindow.ReadNumber()
If
J9<1 Then
GOTO LN735
EndIf
If
J9>5 Then
GOTO LN735
EndIf
For
K=1 To J9
LN760:
TextWindow
.Write("ROOM NUMBER? ")
P[K] = TextWindow.ReadNumber()
If
K<=2 Then
GOTO LN790
EndIf
If
P[K] <> P[K-2] Then
GOTO LN790
EndIf
TextWindow
.WriteLine("ARROWS ARENT THAT CROOKED - TRY ANOTHER ROOM")
Goto
LN760
LN790:
EndFor
' *** SHOOT ARROW ***
L=LA[1]
For
K=1 To J9
For
K1=1 To 3
If
SA[L][K1]=P[K] Then
GOTO LN895
EndIf
EndFor
' *** NO TUNNEL FOR ARROW ***
L=SA[L][Math.GetRandomNumber(3)]
Goto
LN900
LN840:
EndFor
TextWindow
.WriteLine("MISSED")
L=LA[1]
' *** MOVE WUMPUS ***
Sub935()
' *** AMMO CHECK ***
A=A-1
If
A>0 Then
GOTO LN885
EndIf
LN880:
F=-1
LN885:
Goto
ExitSub715
' *** SEE IF ARROW IS AT LA[1] OR AT LA[2]
LN895:
L=P[K]
LN900:
If
L <> LA[2] Then
GOTO LN920
EndIf
TextWindow
.WriteLine("AHA! YOU GOT THE WUMPUS!")
F=1
Goto
ExitSub715
LN920:
If
L <> LA[1] Then
GOTO LN840
EndIf
TextWindow
.WriteLine("OUCH! ARROW GOT YOU!")
Goto
LN880
ExitSub715:
EndSub
Sub
Sub935
' *** MOVE WUMPUS ROUTINE ***
K=Math.GetRandomNumber(4)
If
K=4 Then
GOTO LN955
EndIf
LA[2]=SA[LA[2]][K]
LN955:
If
LA[2] <> L Then
GOTO LN970
EndIf
TextWindow
.WriteLine("TSK TSK TSK - WUMPUS GOT YOU!")
F=-1
LN970:
EndSub
Sub
Sub975
' *** MOVE ROUTINE ***
F=0
LN985:
TextWindow
.Write("WHERE TO? ")
L = TextWindow.ReadNumber()
If
L<1 Then
GOTO LN985
EndIf
If
L>20 Then
GOTO LN985
EndIf
For
K=1 To 3
' *** CHECK IF LEGAL MOVE ***
If
SA[LA[1]][K]=L Then
GOTO LN1045
EndIf
EndFor
If
L=LA[1] Then
GOTO LN1045
EndIf
TextWindow
.Write("NOT POSSIBLE -")
Goto
LN985
' *** CHECK FOR HAZARDS ***
LN1045:
LA[1]=L
' *** WUMPUS ***
If
L <> LA[2] Then
GOTO LN1090
EndIf
TextWindow
.WriteLine("... OOPS! BUMPED A WUMPUS!")
' *** MOVE WUMPUS ***
Sub935()
If
F=0 Then
GOTO LN1090
EndIf
GOTO
LN1145
' *** PIT ***
LN1090:
If
L=LA[3] Then
GOTO LN1100
EndIf
If
L <> LA[4] Then
GOTO LN1120
EndIf
LN1100:
TextWindow
.WriteLine("YYYYIIIIEEEE . . . FELL IN PIT")
F=-1
GOTO
LN1145
' *** BATS ***
LN1120:
If
L=LA[5] Then
GOTO LN1130
EndIf
If
L <> LA[6] Then
GOTO LN1145
EndIf
LN1130:
TextWindow
.WriteLine("ZAP--SUPER BAT SNATCH! ELSEWHEREVILLE FOR YOU!")
L=Math.GetRandomNumber(20)
Goto
LN1045
LN1145:
EndSub
1 Like

Many of the things that people complain about with old line numbered BASIC simply aren’t a problem anymore. Modern BASIC language support structured programming, recursion, long variable and subroutine names, modules, etc. It is still an easy to learn language for the beginner, and if you want to write more serious programs with it, you can.

2 Likes