Mutant Basic I don't often like to write about programming. I don't find interesting texts, videos, or other content about other programmer's experiences. But I think I'll break with that today and do it anyway. Mutant Basic is a variation of the BASIC programming language which I developed and incorporated into this BBS. It serves two purposes: First it allows users a way to create their own door games, and second it allows users a way to create bots for the chat channels. I have a "Programmer's Reference Guide" which you can read if you're interested on getting into the weeds, it's available at http://mutinybbs.com Note, you must use http:// not https:// as this web server does not support SSL. This was originally written prior to Community and was added to Mutiny BBS (The Synchronet BBS on port 2332) as a door, there users could create virtual floppy disks to put their code on. Here on Community (port 2300) it's integrated into the BBS code itself. The original door verison is still available on Mutiny (2332) but a number of improvements and fixes have been made since then and are only in the Community (2300) verison. I don't want to go over everything as it would get quite long and boring but maybe just touch on some of the more unique aspects. The first is just knowing that it's a thing that exists on the BBS. There is no menu item that says "Mutant Basic", instead it was added to the text files subsection which (without going too much on a tangent) was added as a way to allow users to read text files, specifically a mirror of Jason Scott's textfiles.com archive. The way this subsection is desigend mimicks a dos or *nix structure where you use commands like "dir" or "ls" to list contents, "cd" or "chdir" to go into subdirectories, "type", "cat", etc... to read files. After a time I added the ability for users to create their own directories and create their own content (text files). A tangent to the tangent: This is also how Gopherspaces are implemented. Anyway so when it came time to add Mutant Basic to Community it was sort of an invisible feature (like many others on the BBS). You would go into your directory and instead of going into a text editor using something like: "edit mystory.txt" you would give it a .bas extension like "edit mygame.bas" and the BBS would plop you into the Mutant Basic programming environment instead of the usual text editor. This works very similarly to BASIC on 8-bit systems, you can type commands in "immediate mode" and they'll execute as soon as you press enter, or you can add a line number to the start of the line and it'll become part of the program which then executes when you type "run". Anyone who has worked with any of the 8-bit machines will instinctively know what to do here. There are some quality of life features to help with the BBS integration such as environment variables to get the user's ID and name, what terminal emulation type they're using (ASCII, ANSI, CBM, ATASCII), their configured screen size (rows, columns), etc... There's also behind the scenes things going on to try to give (as much as possible) a similar experience for users of different terminal emulation types such as translating block characters between extended ascii, CBM, and Atascii, as well as cursor positioning and coloring commands. For the most part you can just type in basic as you would expect it to run and it'll work. I've tested this with a few examples from the classic book: Basic Computer Games. The part of implementing this that took the most time and *still* to this day needs a little work is "Evaluation". Like in a program like this: 10 a$="Hello":b$="World" 20 print a$;" ";b$;", and especially you, ";USERNAME$;"!" 30 l=int(rnd(1)*100) 40 print "Your lucky number for today is: ";str$(l) The "Evaluation" bits are ... On line 20, getting the value of a$, b$, and USERNAME$, then concatenating them together. On line 30 working out what rnd(1)*100 is and passing that off to INT On line 40 converting l to a string and concatentating it to the rest of the string. These evaluations can get pretty deeply nested like: l=left$(str$(int(rnd(1)*100)),2) And I have to admit it doesn't always work correctly and you have to break it up into smaller statements, but it's *mostly* functional and I do keep making improvements as time permits. Multi-user options: The main game that I play is UR and I'm usually playing it against another user (Ksource), although you can play against the computer as well. This game doesn't allow for two players to be playing at the same time so when we're both online at the same time and playing we jump in and out of the game. When one of us are not in the game we're in chat, so we're probably chatting about the game. This works pretty well, but you can design a game for multiple players to play simultaniously. There was a user a while back who was working on an interesting looking game that took this approach but this user eventually unpublished the game (made it not visible to others) and abandonded it, also I haven't seen him in a while. The approach he was taking originally was to put state changes in the database (oh yeah, did I mention there's database functionality in Mutant Basic? Well, there is). The other running instances of the game (other players) would poll the DB for state changes and update accordingly. This was slow and inefficent but worked. For him I added a way for in-memory variables to be shared without having to rely on the database. It's fairly easy to do you just use the command "share" followed by a list of the variables you'd like to share. Any other running instances of the same BASIC program will then receive updated values for those variables. Arrays Arrays in Mutant Basic are pretty powerful compared to most BASICs. You can have multi-dimensional arrays, associative arrays (dictionaries), and jagged arrays which kind of takes on a new meaning in Mutant Basic. You see, in pretty much any other language when you make an array of, say 10, elements you've set up memory for 10 items: 10 dim myarray(10) You now have 10 variables, basically, myarray(0), myarray(1), ... myarray(9) But in Mutant Basic arrays were implemented by ... not implementing arrays :) In other words, behind the scenes, there's no such thing as an "array" in the traditional sense. Instead there are variables where part of that variable's name (the part in the parentheses) is evaluated. So you can do this: 10 myarray(500) = 3.14159 In any other BASIC you'd have allocated 500 memory locations for numbers and populated the 500th (index 499) with the value of PI. But in Mutant Basic you just created a variable called "myarray(500)" that has a value of PI. So the "work" with arrays isn't in how it's layed out in memory, it's just in how we evaluate the index: 20 i=500:print myarray(i) Here "i" has to be evaluated, gets replaced by its value (500) and now it prints myarray(500), not because it offset 500 spaces from the start of the array, but by just replacing i with 500 and finding a variable with that name. So this is what lets you do associative arrays because anything can be the index, even a string: scores($USERNAME)=100 You can also have multiple dimensions as you could in (most) any BAISC: players($USERNAME,"score")=100 players$($USERNAME,"color")="blue" Note in this case one is "players" and the other "players$" because the value is a string and in basic string variables should have a $ as the last character in the variable name. Did we create 2, 2-dimensional arrays? For all intents and purposes we did, but in reality we just created two variables. You can also use floating point numbers as indices such as: myarray(1.23). If that's useful to you :) Databases Okay as I mentioned earlier there is the ability to tap into a SQL database so that your program can keep state between plays. There is a whole host of commands to allow you to do that assuming you have the sql knowledge: Create tables, select from tables, delete tables, etc... But it's really not necessary to do that and cumbersome to try. Instead the SQL database can be used like a save-state/load-state system. Savestate dumps all in-memory variables into the SQL database (you don't need to know SQL). Then Loadstate loads them back. Usually you would use Loadstate specifying only the variables you want to load so as to not overwrite in-memory variables that you don't want to load. This is what I used in UR and it works pretty well. Okay I think that's way more than enough about Mutant Basic. I'm sure a lot of readers have long since given up and stopped before getting this far and I can't blame any of y'all. If, for some reason, you do find this interesting then check out the PRG mentioned at the start of this article. --- Now for the bonus --- A user on this BBS suggested I write a phlog about phlogging. I already wrote one about why I phlog and why I prefer it to posting on social media or even making BBS posts but he was looking more for technical details about how I do it. Seems boring to me but since this is going to be "the boring article", might as well throw it in. Once I have a topic I want to write about and I think it might be of some interest to someone other than myself (it's not a "dear diary" type thing) then I'll go to the BBS and pop into my personal files directory using /myfiles from there CD to pub (gopher files), and CD again to Phlog (because I try to keep organized). edit (today's date).txt, such as "edit 20260521.txt" and just start typing. I try to hit enter at the end of an 80 column line. The BBS wordwraps well but I've experimented with enough different gopher clients to know they don't always do that as expected (such as Netscape) so I force 80 columns max per- line. Then I proof read it, try to fix my mistakes, and hit /s to save and give it a title. Then I edit the gophermap file here (index.map) and add it to the top. Then I log into SDF and edit the gophermap file there. My "gopherhole" on SDF doesn't contain any document except the gophermap which links back here. There's lot of ways people want to write phlogs and I am working on (or at least thinking of) ways to post phlogs here without using the BBS's built-in editor for those that prefer to use more modern/advanced editors but right now that's a bit difficult. I make typos and mistakes, I try to exercise my own spelling ability. I don't use spellcheck as spellchecks these days pretty much auto-correct leaving me no better a speller than before but I do use a Linux command line tool called aspell which will give me the correct spelling for things and I then manually type the word forcing my fingers to remember how to spell things. I admit I probably do it the hard way but sometimes I prefer doing things the hard way because I think it improves me in the process. The end result isn't really the point, it's getting there that's important for me. .