Beatnik programming language

From ArticleWorld


The Beatnik programming language is a stack-based esoteric programming language that uses the game of Scrabble as a starting point. Beatnik is effectively stack-based, and the programs are made out of any valid English language programs. The value each of these words would get in a Scrabble game is used to select the actual operation that is to be performed on the stack.

Beatnik is also the base of l33t, another esoteric programming language.

Opcodes

According to the Beatnik manual, the opcodes are:

  • <5 Does nothing. The Beatnik Interpreter may mock you for your poor scoring, at its discretion. Low scoring words such as "I" or "of" are probably not good words to program with immediately after stealing all of the interpreter's cigarettes and stomping on its beret.
  • 5 Finds the score of the next word and pushes it onto the stack. Skips the aforementioned next word.
  • 6 Pops the top number off the stack and discards it.
  • 7 Adds the top two values on the stack together (as described above)
  • 8 Input a character from the user and push its value on the stack. Waits for a keypress.
  • 9 Pop a number off the stack and output the corresponding ASCII character to the screen.
  • 10 Subtract the top value on the stack from the next value on the stack, pushing the result.
  • 11 Swap the top two values on the stack.
  • 12 Duplicate the top value.
  • 13 Pop a number from the stack, and figure out the score of the next word. If the number from the stack is zero, skip ahead by n words, where n is the score of the next word. (The skipping is actually n+1 words, because the word scored to give us n is also skipped.)
  • 14 Same as above, except skip if the value on the stack isn't zero.
  • 15 Skip back n words, if the value on the stack is zero.
  • 16 Skip back if it's not zero.
  • 17 Stop the program.
  • 18-23 Does nothing. However, the score is high enough that the Beatnik Interpreter will not mock you, unless it's had a really bad day.
  • >23 Garners "Beatnik applause" for the programmer. This generally consists of reserved finger-snapping.

The punctuation marks are ignored, as well as whitespace characters.