100 Days of Code Day 82
Today’s exercise was Binary Search it should have been a cakewalk but I made some dumb moves that slowed me down.
More work on the BASIC interpreter. But first a short rant. I was watching YouTube last night. Someone had made a BASIC interpreter (spruced up someone else’s really) and wanted to know what they should do with it. The name of that interpreter is the same as the one I am working on. I was going to leave a link but I think Wikipedia just found a third one named uBasic. Granted I was doing a non-creative variation on the Tiny BASIC name but I still wasn’t expecting that. Now I need to rename it at some point.
I never did formally announce it was a BASIC interpreter before have I?
Anyway back to today’s work. I wanted to get INPUT working to be able to run more programs. I was having trouble trying to decide how to type coerce the various entries. The way I have it if you have a type suffix and if it fits it tries to do that, otherwise you get a sort of first/best match. Not sure if Booleans are working but the others seem to. I decided to try running the guess the number game I found somewhere online (sorry didn’t note the location again). This caused me to add in two more built-in functions INT, and RND. I finally learned what the numbers they pass into RND are for. I think GW-BASIC and Q/QuickBasic worked differently for RND (no parameters). A line number with no code in it was giving me trouble. I finally turned it into an empty comment (dirty I know). Almost had it then I ran into the END statement. I thought of deleting it from my example but ultimately put in code to parse it too. After a few = vs == and spacing fixes around + to determine if it is x + 5 or a positive 5, I finally got it running.
The remaining big upgrades to put in are Arrays, Read/Data/Restore, GOSUB, Functions, and File Operations. However, I was also on YouTube and saw this video for OLC Code Jam 2025. I have entered that Jam before and would like to again. So the BASIC interpreter project will be put on the back burner when that comes around unless I don’t like the theme.
