MarcFriedenberg.com

Macboard Documentation

  1. Purpose
    1. The goal of my project was to create and interpret an easy-to-use programming language developed specifically for working with the binary board. By creating functions and a syntax which are simple and error-proof, I hoped to improve upon some of the repetition of programming exclusively in BASIC.
    2. Target audience
      1. The target audience for my product is anybody interested in programming for the binary board. Specifically, users ages 8 and up should be able to understand the syntax and usage of the MacBoard system. The nice part of the system is that it can be ported easily for both Mac and PC (or even *NIX), so anyone can use it.
      2. Code integrity
        1. With my target audience in mind, I made my language interpreter as flexible as possible. In other words, a successful MacBoard file need not have perfect syntax. The user can type in incorrect case, leave senseless white space, ignore the use of semis, leave out parenthesis, and otherwise garble my specification. I do prevent a certain degree of user error, however, by requiring that the first line of the file be “<BOARD>
        2. Should the interpreter stop short of saying ‘End of program’ in the console, execution has stopped almost certainly because of a syntactical error on the user’s part. Be sure to include “for” in a BLINK line, and use SHOW instead of PRINT. In user testing, these were the most common mistakes.
  2. Procedure
    1. Timeline
      1. To be honest with you, I wasted a lot of time in the creation of this system. Once I did buckle down and start working though, I followed a very consistent schedule of programming both in class during the afternoon and at home during the evening. Parts of the programming process were difficult (especially dealing with converting data types and creating the DO loop), but as with most things in life, a diligent effort slowly eroded at he problem. I would estimate that about 75% of the process was code writing and 25% was debugging. Of course this is basically the inverse of what computer scientists generally recommend, but I’m such a great programmer, I don’t even need to bother with debugging.
  3. System requirements
    1. The MacBoard system does not require many system resources in order to run. It can run on Mac OS 8.6 and earlier, OS 9, Mac OS X, all flavors of Windows, DOS, and *NIX. Basically, if your computer is capable of running one of the OS’s listed, it is capable of running MacBoard.
    2. If you actually want to run the interpreted BASIC code, you will need a PC with a parallel port capable of running QBASIC.
  4. Language prototype
    1. MacBoard supports the following command, which must be wrapped by <BOARD> and </BOARD>:
      1. SHOW Text; Print a message to the console
      2. NOTE Text; Adds a comment to the code
      3. ON (Light, Light); Turns on the specified lights
      4. OFF (Light, Light); Turns off the specified lights
      5. ALL ON; Turns on all lights
      6. ALL OFF; Turns off all lights
      7. BLINK (Light, Light) FOR Num TIMES; Blink the lights a specified number of times
      8. ROTATE (Light, Light); Turns on each light in order for 1 sec
      9. RANDOM; Turns on a random light
      10. SLEEP (Num); Sleeps for the specified number of seconds
      11. The do loop, as follows:
        DO Num TIMES
        {
        Lines of code
        }
  5. Sample code
    1. The following should be self-explanatory and provides an easy overview of the MacBoard commands:
      <BOARD>
      ALL ON;
      NOTE "TURNS ON ALL THE LIGHTS";
      RANDOM;
      SHOW "I JUST TURNED ON A RANDOM LIGHT";
      DO 4 TIMES
      {
      ON (1,3,5,7);
      NOTE "I TURNED ON SOME LIGHTS";
      OFF (3,5,7);
      SHOW "NOW ONLY THE FIRST LIGHT IS ON";
      SLEEP (4);
      }
      NOTE "KEEP IT THAT WAY FOR 4 SECONDS";
      BLINK (1,2,3,4,5,6,7,8) FOR 20 TIMES
      SHOW "I AM BLINKING ALL THE LIGHTS 20 TIMES";
      SHOW "NOW THE PROGRAM IS DONE";</BOARD>
    2. After using the MacBoard system, the following QBASIC code would be generated:
      'BEGIN MACBOARD PROGRAM
      OUT (888), 255
      'TURNS ON ALL THE LIGHTS
      OUT (888), 1
      SLEEP (1)
      PRINT "I JUST TURNED ON A RANDOM LIGHT"
      FOR U=1 TO 4 STEP 1
      OUT(888), 85
      'I TURNED ON SOME LIGHTS
      OUT(888), 1
      PRINT "NOW ONLY THE FIRST LIGHT IS ON"
      SLEEP (4)
      NEXT U
      'KEEP IT THAT WAY FOR 4 SECONDS
      FOR Y=1 TO 20 STEP 1
      OUT(888), 255
      FOR WAIT=1 TO 10000 STEP 1 'THE PAUSE BETWEEN BLINKS
      NEXT WAIT
      OUT(888), 0
      NEXT Y
      PRINT "I AM BLINKING ALL THE LIGHTS 20 TIMES"
      PRINT "NOW THE PROGRAM IS DONE"
      'END OF PROGRAM
  6. How to use the system
    1. The MacBoard system is very easy to use. Simply make sure that a valid MacBoard file is in the execution folder (the folder that MacBoard is running within.) When prompted, type the name of the file, case insensitive. MacBoard handles the rest. As for actually running the program, you will have to move the outputted code (copy and paste from the console, saving, e-mail, etc.) to a machine capable of running QBASIC. MacBoard was designed so that execution would be as simple as that.
  7. Ideas for future versions
    1. Due to time constraints, there were several features which I was not able to implement in the MacBoard system. The primary two were true SCSI/parallel support and the ability to use nested loops. SCSI support on the Mac will require the use of the SCSI manager under OS9 and earlier, which tends to be rather low-level. Adding support for nested loops will require a large amount of migraine-inducing programming, because the current system is designed in such a way that encountering a “}” exits the DO loop. Obviously it is technically possible to work around this, but I was unable to do so in the current version of the project.