This is an easy enough question to answer now, but in 1978 when all you've got is a box of blinkenlights and your friends think of a computer as something that fills up a room and screws up your tax refund checks, the point of the question is a little more urgent. After all, your friends just saw you drop how much on that thing?
This guy, name of Larry, decides to do something about it. He calls it Waduzitdo and uses it to write silly little quiz programs for his friends. The language is sort of like (and probably based on) Pilot, a fairly ugly cross between Basic and assembler that has sunk into considerable obscurity (but is still available from The Retrocomputing Museum) but a lot smaller. It's not Turing-complete by any useful standard; while it does have conditionals and branch instructions, it doesn't actually do anything to the data it eats. Thus Waduzitdo 2001.
This is the original language, documented second-hand thanks to some anonymous CS prof somewhere. The language itself is, like Pilot, very much like a simple assembly language with opcodes and data fields. Looks a little like this:
Obviously we've got much more memory to play with than Larry did in 1978, so things are a bit different. We could be nice and make the whole thing stack-based, but that would be too pretty, elegant, and easy. So we got two registers: the accumulator and the match flag. The accumulator holds one value, either a number or a string. The match flag holds one value, either true or false.
This should get you backwards compatibility. Worry not about the fact that the original spec says "character" as opposed to "string"; I'm not.
All statements take the form
modifier opcode: data
Data may be blank if you've got nothing to put in it. The colon is mandatory. You may not use a semicolon. I don't care if you want to use a semicolon; you're not allowed to Period.
T | type | displays data on the console |
A | accept | accepts one line of input into the accumulator |
M | match | compares data to the accumulator and sets match flag to TRUE if true, FALSE if not true. |
J | jump | If data is 0 or nonexistent, jump back to the last accept statement. Otherwise, jump forward by data * markers. |
S | stop | Stop program. |
These are sort of part of the opcode kinda. They tell the interpreter how to interpret the following line.
* | label | Marks a line that can be jumped to |
Y | if yes | Executes the following line only if the match flag is set |
N | if no | Executes the following line only if the match flag is not set |
Wdz2K1 is slightly more capable than the original because the restrictions on the design aren't as tight as they were on those early personal computers. Therefore, Wdz2K1 explicitly specifies the accumulator variable that the original spec implied, and adds the stipulation that it can handle data more complex than a single character. The truly lazy implementor can do something funky with the string matching that kicks the whole thing back to a Perl interpreter or something like that and do regexp matching, but that would be silly.
Please let me know if I can add any more lame jokes to this section.