All arithmetic operations in Beatnik are executed on a stack. The only data type of Beatnik is an unsigned 8-bit value, so only values from 0 to 255 can be represented.
Scrabble Values
Value
DEU-Scrabble
ENG-Scrabble
1
D, A, I, R, T, U, S, N, E
E, A, I, O, N, R, T, L, S, U
2
G, L, O, H
D, G
3
W, Z, B, M
B, C, M, P
4
P, C, F, K
F, H, V, W, Y
5
K
6
J, V, Ä, Ü
8
X, Ö
J, X
10
Q, Y
Q, Z
Beatnik-Commands
Wordvalue
Pseudo-Code
Explanation
< 5
noop
Optional: the interpreter might scoff.
5, n
push n
Puts the next word on the stack
6
pop
Takes the top value from the stack.
7
add
Takes two values, adds them and puts the result on the stack.
8
input
Reads an input and puts the character value on the stack.
9
output
Takes the top value from the stack and outputs the corresponding character.
10
sub
Takes two values, subtracts the first value from the second and puts the result on the stack.
11
swap
Swaps the two top values of the stack.
12
double
Takes the top value from the stack and puts it on the stack twice.
13, n
jump z +n
Takes the top value from the stack and jumps n places forward if the value is 0.
14, n
jump nz +n
Takes the top value from the stack and jumps n places forward if the value is not 0.
15, n
jump z -n
Takes the top value from the stack and jumps n places backward if the value is equal to 0.
16, n
jump nz -n
Takes the top value from the stack and jumps n places backward if the value is not 0.
17
halt
Terminates the program.
18 – 23
noop
Optional: the interpreter might scoff if it is in a bad mood.
> 23
noop
The interpreter applauds the programmer for the high score.