Category Archives: Color BASIC

UnderColor’s spiral challenge from 1984 – part 1

See Also: part 1, part 2, with part 3 and part 4 coming (and maybe more).

And now back to CoCo …

– Michael Pittsley posted in the TRS-80 Color Computer (CoCo) group on Facebook:

Many of us have our CoCos and have memories or how good we once were writing basic programs on it. Including myself. I found this article in the first UnderColor magazine. It was a contest to see who could write an ECB program that created a spiral. — Write an Extended Basic program that draws a spiral figure on graphics screen 0 on PMODE 4. The figure, when done should look like the picture. Use any combination of Basic commands, but no assembly language. The winner will be the person whose program executes in the shortest possible time. (Entries that simply list a series of LINE commands will be disqualified). I took a stab at it and realized how much I had forgotten about basic, so this was fun for me. I put my results as the first comment. Feel free to try your hand at it, post a screen shot and the time it took to complete.

– Michael Pittsley

This caught my attention.

UnderColor magazine (1984-1985) was one I never saw, though the name sounds familiar so I may have at least read a reference to it, or seen an ad for it somewhere. You can find the issues preserved here:

Search – TRS-80 Color Computer Archive

The article in question appeared in the first issue, which you can read here:

UNDERCOLOR Vol1 No 1 Dec 10, 1984

The article, by Bill Barden, presented a contest to see who could write a program in BASIC (no assembly allowed) that would generate a spiral as demonstrated by this graphic:

The winner would be the program that could do this in the least amount of time.

I have discussed drawing spirals on the CoCo in the past, but not like this. I also wrote about spirals for a text mode attract screen, but not like this.

So now let’s spiral like this.

LINE versus DRAW

The most obvious approach would be to use the LINE command. It takes a set of X and Y coordinates and draws a line between them, like this:

LINE (0,0)-(255,191),PSET

However, with what I know about BASIC these days (and wish I knew back then), that is alot of parsing of numbers and characters and such. That makes it slower than it might need to be.

One shortcut is that LINE remembers where it left off, so you can start a new line just by specifying the destination:

LINE-(127,0),PSET

Doing this trick should speed up a spiral program, since you only need to give the starting point once, then you can just “draw to the next spot” from then on out.

But I did not attempt this. Instead, I thought about DRAW.

The DRAW command is very powerful, and does allow you to draw to specific coordinates. You can do a “blank” draw just to move the starting point, like this:

DRAW"BM0,191"

That will do a Blank Move to (0,191), which is the lower left corner of the screen and the location where the spiral is supposed to start.

You can then do things like…

DRAW"R10"

…and that will draw a line 10 pixels to the right. (Well, the coordinates are scaled, I think, so it is 10 pixels on a PMODE 4 screen, but at other lower resolutions, that number of pixels will be scaled down.)

How can we spiral like that? One way would be to build a string and append it:

X=100
X$=STR$(X)
DRAW"R"+X$

That works, but all that parsing and creating strings and such would certainly be slower than using a built-in feature of DRAW which lets you use a variable inside the quotes! You just put “=” before the variable name, and a “;” after it.

X=100
DRAW"R=X;"

That will draw to the right however many pixels X is set to!

Could this be faster than line?

Here is what I came up with:

0 'SPIRAL1.BAS
10 TIMER=0
20 PMODE4,1:PCLS:SCREEN1,1
30 W=255:H=191:DRAW"BM0,191"
40 DRAW"R=W;"
50 DRAW"U=H;L=W;"
60 H=H-3:W=W-3
70 DRAW"D=H;R=W;"
80 H=H-3:W=W-3
90 IF H>0 THEN 50
100 TM=TIMER
110 IF INKEY$="" THEN 110
120 PRINT TM/60

This sets a TIMER variable at the start, draws the spiral, then reads the value of the TIMER again. When you press any key, the program exits and prints the time (TIMER/60) it took to run the main code.

Here is what I get:

And pressing a key shows me:

3.03333334

Three seconds.

I expect I can optimize my program to speed it up. In the meantime, what can you come up with? Is there a faster way?

Let’s play!

Ciaran “Xroar” Anscomb’s PCLEAR 0 without assembly!

On the CoCo mailing list, Ciaran (author of the Xroar emulator), said this:

FWIW this is the bodge I have saved out for doing PCLEAR0 without such
ROM patching:

POKE183,PEEK(183)-6:POKE188,PEEK(188)-6:PCLEAR1:POKE183,PEEK(183)+6:POKE188,PEEK(188)+6

Annoyingly verbose, but should account for DOS, and works on the
Dragon too.

..ciaran

https://pairlist5.pair.net/mailman/listinfo/coco

This topic came up because of Juan Castro‘s experiments with updating HDB-DOS to add new functionality on a CoCo 1 and 2 (but that is a discussion for a dedicated blog post sometime). Juan had recently “fixed” Extended Color BASIC to allow using “PCLEAR 0” to remove all graphics memory and give more RAM to BASIC. I have discussed PCLEAR 0 in the past

This mysterious line performs a PCLEAR 0 without needing to load and run program of assembly code!

POKE183,PEEK(183)-6:POKE188,PEEK(188)-6:PCLEAR1:POKE183,PEEK(183)+6:POKE188,PEEK(188)+6

And it works!

But … how does it work!?!

Ciaran, you’ve got some ‘splainin’ to do…

Until then…

A BASIC coin flip…

Us humans (this is not an A.I. post, bleep bloop) have a tendency to try to find patterns in randomness. For example, when asked to pick a number between 1 and 10, a magician/mentalist will know that statistically humans are more likely to choose certain numbers. There is alot of “human nature” that makes us somewhat predictable.

In a deck of 52 playing cards, if you were asked to predict what card is on the top of a shuffled deck, you probably wouldn’t say Ace of Diamonds, but that card is just as likely to be there as any other. No matter which card you guess, you have a 1 in 52 chance of being correct.

Call it in the air…

When it comes to a coin toss, do you always call heads? Always tails? Or do you alternate?

When a gambling casino game presents a grid of squares and asks you to pick four squares, do you “randomly” pick various squares, or do you just click the first four on the top row?

If it is random, either should have the same outcome.

And don’t get me started on picking lottery numbers. While we do not often see the picked numbers be “1, 2, 3, 4, 5 and 6”, that sequence should be just as likely as any other.

If it is random.

So let’s play a game in BASIC with a coin toss. Heads or tails will be represented using CoCo’s Color Basic RND() command. Doing RND(2) will produce either a 1 or 2 result.

NOTE: This is not random. This is psuedo random. I have discussed this previously, but for the sake of this blog post we will pretend it truly is random.

Would calling heads every time produce a better result than calling tails? Or would randomly choosing heads or tails each flip be better?

Let’s try…

0 'COINFLIP.BAS
5 'POKE 65495,0
10 W1=0:W2=0
20 FOR A=1 TO 1000
30 V=RND(2)
40 IF V=1 THEN W1=W1+1
50 IF V=RND(2) THEN W2=W2+1
60 NEXT
70 PRINT "ALWAYS GUESSING 1:";W1
80 PRINT "GUESSING RAND 1-2:";W2

This program will “randomly” flip a coin 1000 times and count how many times it landed on heads (1) versus how many times it matched a randomly (1-2) chosen value. At the end, it will print the results:

As you can see, in this “random” test, neither method really proved to be that different. We could also alter the output to print how many times guessing tails (2) would have worked (1000 clips minus how many times it was heads, 511 in this example, so 489 if my math is correct).

But it still feels better thinking we have some “control” over things and guessing rather than always choosing the same guess.

Alphabetically speaking…

Let’s modify the program to select a random letter, A-Z (represented by 1-26). We will now always guess A, versus randomly guess a letter (1-26):

0 'COINFLP2.BAS
5 'POKE 65495,0
10 W1=0:W2=0
20 FORA=1TO1000
30 V=RND(26)
40 IF V=1 THEN W1=W1+1
50 IF V=RND(26) THEN W2=W2+1
60 NEXT
70 PRINT"ALWAYS GUESSING 1:";W1
80 PRINT"GUESSING RND 1-26:";W2

And here is what I get…

Maybe this perspective will help you “always choose tails” or “always guess Aces of Spades” in the future.

And speaking of the future, there is another “random” test I want to experiment with, coming soon.

Until then…

Using BASIC to prove a (dumb) point.

I recently got lured in to downloading some casual game for my phone. (Thank you, gas station rewards program, for telling me I could earn a bonus from you if I downloaded this stupid game.)

I gave up these time wasters years ago when I realized how much time they wasted.

But with this addictive substance back on my phone, I was thrown back in and realized… nothing has changed. It’s even worse. These games are not games. They are ad platforms. Every few minutes you get an ad. Or, you have to watch an ad to get something you need.

I will repeat… These games are not games. They are ad platforms.

But, once new trend is how many ads for other games I see that offer “real cash” for playing them. They show folks who are broke pulling out their phone and then playing to get the money they need. “It’s just that easy!”

Obviously, if you could easily make hundreds of dollars playing a game, you wouldn’t need to pay to advertise that game. People would all know about it from word-of-mouth and we’d all be doing that.

What is even more amusing (at least to me) is how many ads warn you about “scam games” … while basically being the same game they are warning you to avoid.

But one thing caught my attention… These ads will claim to be “skill based” games. Many of them are card games like Solitaire.

While it is true there is skill to know how to play a certain set of random cards you have been dealt, there is zero skill that can prevent you from losing if you get enough bad hands. Likewise, any “skill” game that uses a roll of the dice you can 100% be guaranteed to lose if you had enough random bad rolls of the dice and your opponent had enough random good rolls.

And that gave me a (dumb) idea…

The house always wins.

As a kid, I remember playing Battleship with friends. In case you are unfamiliar, here is the wiki page for this game:

Battleship (game) – Wikipedia

Basically, you place your ships on a grid, aligned vertically or horizontally, and your opponent does the same. You then call out the coordinate you want to “bomb” on your opponent’s grid, and they tell you if you had a “hit” or a “miss.”

Some of us cheated.

Since there was no way to verify where the ships were, if your opponent called a shot that was a “hit,” you could easily move your piece out of the way to a new spot and report “miss.” Evil. But fun. This caused LONG games, playing until you basically got down to where the ships had no other place to be.

Because of this, I never trusted the Battleship clone I played on my Radio Shack Color Computer. How could I ever trust that computer wouldn’t “cheat” the same way?

But hey, Battleship is a game of skill — after all, it does not use any random roll of the dice or deal of a card.

But the card and dice games are completely “random” and no matter how skilled you are, you can have a hard time winning against bad randomness ;-)

I thought it would be fun to write a simple BASIC Blackjack (or 21) card game, except the computer would cheat. It would have a list of all un-dealt cards, and ensure it always gives the best card to the dealer, and the worst to the opponent. If things were truly random, this is a possibility with a truly random outcome.

The same cheating computer could be done for any random game — just as Monopoly. Imagine ALWAYS getting a roll that makes you pay rent or Go To Jail, while the computer always got a roll that got them to a safe property, or one they could buy.

Shall we play a game?

I will not present code for this yet. I have not written it. But, perhaps one of you will beat me to it.

My idea:

  1. The cards are in a random array of 52.
  2. The computer dealer will always get the best cards. Initially a face card and an ace, then as those cards are depleted, two cards totaling ten. At that point, there is no way the player can ever get two cards at 21. And, if the player got 20, the “house always wins” so even if that happened, the computer wins.
  3. After the player receives its cards, any request to “hit” would be a card just enough to make them bust.
  4. This process would continue through the rest of the deck.

I am unsure if, at some point, it would ever turn into a “fair” game. And this is why I want to write this dumb idea.

Thoughts?

Color BASIC supports two letter variables, except when it doesn’t.

See Also: Forbidden Variables and how to use them.

Updates:

  • 2025-05-14 – Updating the list, and organizing by where they became forbidden.

Over on the CoCo Facebook group, in a discussion about “why is I always used for loops”, Rob R. left a comment that caught my interest:

“… I have a vague memory that (at least on the Mod I) there were one or two letters that weren’t usable since they could be tokenized to a command. At least some two letter variables would be verboten, like ‘TO.'”

– Rob R. on Facebook

This made me wonder: how many are there? Here are the ones that I think would be problematic:

Forbidden in Color BASIC and beyond

  • GO – part of GO TO
  • IF – as in “IF A=1”
  • ON – as in “ON X GOTO/GOSUB” or on the CoCo 3, “ON BRK GOTO” or “ON ERR GOTO”
  • OR – as in “IF A=1 OR A=2”
  • TO – as in “FOR I=1 TO 10”

Forbidden in Extended Color BASIC and beyond

  • FN – as in “DEF FNA(B)=B*42”

Forbidden in Disk Extended Color BASIC and beyond

  • AS – in Disk BASIC, there is an “AS” keyword used for the file system. “FIELD #1, 10 AS A$”

Using any of these such as “TO=1” or “FN=3” will create a ?SN ERROR.

Are there others?

Also, some of these will work in Color BASIC that will not work if you have Extended or Disk BASIC:

  • “DEF FN” was added in Extended, so on a Color BASIC machine you should be able to use FN as a variable.
  • “AS” was added in Disk BASIC, so you should be able to use AS on Color and Extended BASIC.

I wonder how many folks wrote BASIC programs using variables that were not allowed when they later added the Extended BASIC ROM and/or Disk BASIC, and wondered why they stopped working?

Until next time…

Color BASIC decimal, hex and octal are not the same?

There is something wonderful about having a poor memory. Whether I knew something before or not, I do not remember it now, so I get the pleasure of “learning something new” even if I previously knew the new thing.

In a reply to my Color BASIC and octal post, Juan Castro mentioned another quirk about how BASIC sees numbers represented as decimals versus hex or octal.

AND, OR, AND NOT demand signed 16-bit integers as input, whereas the &H/&O expressions (and consequantly my &B extension) return UNsigneded integers. That is VERY annoying:

PRINT &H8001 AND &H0007
?FC ERROR
OK

Come the %#&*£ ON!

– Juan Castro

I am unsure about this, since after the parser reads through the code, it turns any hex or octal or decimal value intothe internal 5-byte floating point representation of the value. “A=65535” turns into exactly the same type of variable as “A=&HFFFF”.

AND and OR should deal with them exactly the same way. In Juan’s example, decimal values will generate the same ?FC ERROR. But there is a workaround…

I stumbled upon this when playing around with using AND and OR to set or test bits. My Color BASIC and 16-bits and AND and OR and NOT article explains what I was trying to do, and how I ultimately ended up achieving it.

In Juan’s example, &H8001 is 32769 in decimal. &H0007 is 7. Having the “high bit” (bit 15) set of the first value effectively makes it a negative number:

1000000000000001 = &H8001 (32769)
^ ^
bit15 bit0

Any value with that bit set will not work with AND or OR, regardless if you represented it in decimal, hex or octal. You can go up to &H7FFF (32767) using AND or OR, but past that, you get the ?FC ERROR:

Juan has been working on some BASIC enhancements, adding new features (like a method of representing values in binary — which I would find quite useful). But seeing numbers in binary not work would be even more frustrating:

PRINT &B100000000000000 AND &H1
?FC ERROR

…at least, that is my assumption about what is “&B” binary representation would do.

Here is how to make Juan’s code work:

PRINT (&H8007-65536) AND &H0007
1

Any value that has that high bit set needs to have 65536 subtracted from it, then you get the results you would expect.

But unfortunately, you cannot use AND to test for that high bit to be set ;-) so instead you have to do silly things like this:

V=&H8007
IF V>&H7FFF THEN V=V-65536
PRINT V AND &H0001

And it’s just that easy!

Though, if you print V, you will see it is a negative number, as you might have guessed. If you don’t need to PRINT V, doing something as simple as this will let you AND and/or OR on values that have the high bit set.

Yuck.

“Come the %#&*£ ON!” is right.

Until next time…

What are the odds?

Back in the early 1980s, a friend of mine had TRS-80 Model III in their house. His mother was a writer, and had gotten it to use for writing books.

I believe it was this TRS-80 where I saw a version of Monopoly that taught me a strategy I had never learned as a kid:

The computer bought EVERYTHING it landed on, even if it had to mortgage properties to do so.

This simple strategy was a gamble, since you could end up with too many mortgaged properties and no source of income from rent. But. by doing this, the computer would end up owning so many random pieces it made it difficult to own a monopoly yourself.

And since then, that is how I played Monopoly. When it worked, it created some awfully long games (if no one had a monopoly to quickly drive other players bankrupt when they landed on their hotels).

In more modern times, I have watched YouTube videos concerning Monopoly strategies. They will break down the statistical odds of landing on any particular piece of property. For example, you know a pair of dice can produce values from 2 to 12. If truly random, the odds of getting a “1 and 1” should be the same as getting a “3 and 5.” Rather than focus on dice rolls, the strategies take into consideration things that alter locations: Go To Jail, Advance to Go, Take a Ride on Reading, etc.

These cards existing means there are more chances for a player to end up on Go, Reading Railroad, Jail, etc. This means the property squares after those spots have more chances of being landed on.

Board with board games. Move along…

But I digress… As Internet Rabbit Holes do, this led me to watch other videos about statistics in things like card games. In a randomly shuffled deck, there should be as much chance for the first card to be Ace of Spaces as there is for it to be Three of Clubs. It is random, after all.

For that first card drawn, that is a 1 out of 52 chance to be any card in the deck. (52 cards in the deck.)

But as a game plays on, there are fewer cards, so the odds of getting any of the remaining cards increases. For the second card drawn, you now know there is a 0% chance of getting whatever the first card is, and a 1 in 51 chance of getting any of the rest.

And so it continues…

For games like Blackjack or 21, you do not really care if it is a Ten of Diamonds or a King of Hearts or a Queen of Clubs or a Jack of Spades. They all have the value of 10 in the game. Thus, the likelihood of drawing a ten card is much higher than any other card in the deck.

You have four suits (clubs, spades, hearts, diamonds) so there are four of each card – Aces, Two through Ten, Jacks, Queens, and Kings. This means there are 16 cards in the deck that could be a value of 10 in the game. When you draw the first card, you should have a 16 in 52 chance of it being a ten card. That is about a 33% chance!

If you pay attention to what cards have been seen (either by you having it, or seeing it face up with another player), you can eliminate those cards from the possibilities — changing the odds of what you will get.

This is basically what I understand card counting to be. If you play a game, and you know you’ve seen three Kings so far (either in your hand, or played by others), you now know instead of four chances to draw a King, you only have one.

Math is hard. Make the computer do it.

I know this has been done before, and quite possible even on a Radio Shack Color Computer, but I thought it might be fun to create a program that displays the percentage likelihood of drawing a particular card from a deck. I suppose it could have the Blackjack/21 rule, where it treads 10, Jack, Queen and King the same, versus a “whole deck” rule where each card is unique (where you really need an 8 of Clubs to complete some run in poker or whatever game that does that; I barely know blackjack, and have never played poker).

I plan to play with this when I get time, but I decided to post this now in case others might want to work on it as well.

I envision a program that displays all the cards on the screen with a percentage below it. As cards are randomly drawn, that card’s percentage goes to 0% and all the others are adjusted.

It might be fun to visualize.

More to come, when time allows…

Counting characters in a string in Color BASIC

And so it begins…

I want to visualize some playing card statistics, and the easiest way I could think of to do this was to write a program in BASIC. Of course.

There are many approaches I can take, so as I put figure it out I will “show my work” and experiments that help me figure out which one will work best.

For my task, I will greatly simplify a deck of cards by ignoring suits (I just care if it’s an Ace, a Five, a King or whatever). I figure I can store it as a 52-character string representing each card:

A123456789JQKA123456789JQKA123456789JQKA123456789JQK

I could “shuffle” this “deck” and end up with a string in “random” order. I believe I have touched on randomizing a list in the past, and had some great suggestions in comments on how to do it better. Forgetting all of that, let’s just say I end up with as string that gets randomized.

But I digress…

The next question will be: “How many Kings are left in the deck?”

Some of you will already see I am heading down a poor path for doing this, but let’s start there anyway.

One way of counting a specific character in a string is to loop through it and use MID$ to pull out an individual character. Something like this:

FOR A=1 TO LEN(A$)
IF MID$(A$,A,1)="S" THEN C=C+1
NEXT

That would count all the “S” characters that appear in the string. Since every time MID$ is used it has to build a new string representing that portion of the original string, this should be our slowest way to do this. On a system with tons of strings in use, string manipulation gets real slow. For such a simple program, this might be fast enough.

Another approach, which was originally shown to me during a word wrap article as a submission, would be to use VARPTR to get the memory location of the 5-byte string ID memory, and then go to the memory where the string bytes are stored and use PEEK to look for them. You can find details in my earlier article on VARTPR.

The memory location that VARPTR returns will have the length of string as the first byte (byte 0), then an empty byte (byte 1, always 0), then the next two bytes will be the address where the string is stored (bytes 2 and 3) followed by a zero (byte 4). Knowing this, something like this would do the same thing as MID$:

A=VARPTR(A$)
SL=PEEK(A)
SS=PEEK(A+2)*256+PEEK(A+3)
FOR A=SS TO SS+SL-1
IF PEEK(A)=ASC("S") THEN C=C+1
NEXT

And do it faster.

VARPTR is a legal BASIC function, but it still seems nasty to reach in to string memory to do this. Thus, I came up with the idea of using INSTR. This function returns the start location of a matching string in another string, or 0 if not found:

PRINT INSTR("ABCDEFG","D")

That should print 4, since a “D” is located at the 4th position in the string.

You can also add an additional parameter which is where in the string to start searching. Doing this:

PRINT INSTR(5,"ABCDEFG","D")

…would print 0, because it starts scanning at the 5th character (just past the D) of the string, and then won’t find anymore.

I could start using INSTR with a position of 1 (first character), and if it comes back with a value other than 0, I found one. That value will be the position of the found character. I could then loop back and use that position + 1 to scan again at the character after the match. Repeat until a 0 (no more found) is returned. That lets the scan for characters be done by the assembly code of the BASIC ROM and is even faster. It looks like this:

F=0
xxx F=INSTR(F+1,A$,T$):IF F>0 THEN C=C+1:GOTO xxx

And we put them all together in a benchmark test program…

10 ' COUNTSTR.BAS
20 A$="THIS IS A STRING I AM GOING TO USE FOR TESTING. I WANT IT TO BE VERY LONG SO IT TAKES A LONG TIME TO PARSE."
30 T$="S":T=ASC(T$)
40 '
50 ' MID$
60 '
70 PRINT "MID$:";TAB(9);
80 TIMER=0:C=0
90 FOR A=1 TO LEN(A$)
100 IF MID$(A$,A,1)=T$ THEN C=C+1
110 NEXT
120 PRINT C,TIMER

130 '
140 ' VARPTR
150 '
160 PRINT "VARPTR:";TAB(9);
170 TIMER=0:C=0
180 A=VARPTR(A$)
190 SL=PEEK(A)
200 SS=PEEK(A+2)*256+PEEK(A+3)
210 FOR A=SS TO SS+SL-1
220 IF PEEK(A)=T THEN C=C+1
230 NEXT
240 PRINT C,TIMER

250 '
260 ' INSTR
270 '
280 PRINT "INSTR:";TAB(9);
290 TIMER=0:C=0:F=0
300 F=INSTR(F+1,A$,T$):IF F>0 THEN C=C+1:GOTO 300
310 PRINT C,TIMER

And running prints:

Wow, using INSTR is six times faster than MID$? And four times faster than VARPTR. Nice.

Now you know a bit about what I need to do. I need to represent cards in a deck (and be able to “draw” cards from that deck) and calculate how many of a specific card remain in the deck.

Since I do not need to track or show the suits (hearts, spaced, clubs, diamonds), I figure I could use one byte in a string.

To be continued … but in the meantime, do you have a better approach? Comment away!

BASIC and many input options…

Earlier this year, Jason Pittman shared a BASIC program with me that drew representations of all the letters of the alphabet. It was a cute program, and did some fancy drawing.

To select a letter, there was this block of code:

130 PMODE3,1:A$=INKEY$
140 IFA$="A"THEN410
150 IFA$="B"THEN510
160 IFA$="C"THEN590
170 IFA$="D"THEN680
180 IFA$="E"THEN750
190 IFA$="F"THEN820
200 IFA$="G"THEN900
210 IFA$="H"THEN1020
220 IFA$="I"THEN1100
230 IFA$="J"THEN1130
240 IFA$="K"THEN1220
250 IFA$="L"THEN1340
260 IFA$="M"THEN1410
270 IFA$="N"THEN1490
280 IFA$="O"THEN1560
290 IFA$="P"THEN1680
300 IFA$="Q"THEN1780
310 IFA$="R"THEN1890
320 IFA$="S"THEN2020
330 IFA$="T"THEN2100
340 IFA$="U"THEN2190
350 IFA$="V"THEN2250
360 IFA$="W"THEN2360
370 IFA$="X"THEN2440
380 IFA$="Y"THEN2490
390 IFA$="Z"THEN2550
400 GOTO130

I thought it might be fun to ask you — in the comments — to tell me how YOU would have done this. I can think of one way, that uses an Extended BASIC keyword, and another way, that would work on Color BASIC.

For a series of options that are sequential (like “A to Z”) there are certainly some options.

As a part two … what if they were not sequential? What if it was for a menu that had options like “A, B, C, D, Q, Z” or whatever? That let me think of a third way to do it to work in Color BASIC.

Comment away!