Waduzitdo: a simple language anyone can learn, part 1

Back in the late 1970’s, having a home computer was unique, not many people had one.  And, when those who did have one had family or friends over, the question that was asked was ‘Well, what does it do?’ Unfortunately, back then, they didn’t do a whole lot unless you knew how to write code.  That usually meant either some flavor of Basic or you had to learn assembler or ‘machine code’.  I did quite a bit of ‘machine code’ as I could not afford a full blown assembler.  Anyway, someone got tired of answering the question and whipped up a little language called ‘Waduzitdo’.  This little language was small, had few statements and was easily learned. 

Waduzitdo had little structure, statements were in the form of:

statement: value or text

There were seven statements:

Statement Parameter Meaning
T text Type <text> on the console
A variable Ask a question, put answer in <variable>
M<variable> text Match <variable> with <text> result goes on stack
JY jump number Jump if stack is true to line number
JN jump number Jump if stack is false to line number
J jump number Jump to line number
E none End

As you can see, it was REALLY simple. A sample ‘application’ would look like:

*T: Hello, this is Waduzitdo.
T: What is your name?
A: n
T: Hello,
T: Do you want to see this again?
A: a
M: yes
T: Good bye!

A few things, the asterisk is a line number.  Rather than using numbers, you used asterisks.  The first asterisk is ‘line 1’, second is ‘line 2’ and so on. As programs will be small, keeping track of them should not be an issue.  Variables can be on both sides of the colon, depending on the statement. For statements that have no parameters, like Accept, the variable is on the right. If the statement does have a parameter, the variable goes on the left. The Y and N goes before the colon. 

HalfByte’s implementation will include the core of the language and support for graphics, sound and limited math and the nunchuck.  The graphics will be similar to ‘turtle graphics’ of the 70’s and 80’s.  While I have not yet settled on a complete feature set, I do know that standard math, random numbers and limited string support will be there.  I will use some of the code from Tiny Basic but most of it will be new.  I am not going to use any of the source from the original language, but I am going to attempt to adhere to its style.

My goal is to document, via this blog, the process of writing this language for the Half-Byte Console (and other Arduino compatibles.)

So, stay tuned!  This should be fun.