The main construct that Pada uses is a 3 level switch design something like this:
/ / / / / / / 0 0 0 0 0 0 0 0
Each of the "/" characters corresponds to a switch that can point either to the left or the right (and initially points to the left). Commands start at the top switch and fall down to the switch on the side of the one they land on until they are executed. Each of the "0" characters is a bit that corresponds to a bit stack.
The "." command will flip the direction of the switch it lands on. In order to manipulate the lower levels of switches, the "O" and "o" commands are used. The "o" command moves in the direction of the switch it lands on and then becomes a ".". The "O" command does the same thing but become a "o" instead. "Q" and "q" are the same but they flip the switch they touch before falling down to the lower level. Example:
o / . / / / / / / \ / / / / / / / / / / / / / 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
O - Become o o - Become . . - Flip switch landed on Q - Flip and become q q - Flip and become .
All of these commands operate on the bit that they eventually fall on.
1 - Set the bit to 1 0 - Set the bit to 0 ~ - Flip the bit v - Push the bit onto its bit stack ^ - Pop the bit from its bit stack
These read/write the byte starting from the bit it lands on, wrapping around
w - Sends the byte to stdout r - Reads one byte from stdin
# - prevent bit from changing until it gets another # (popping throws away one bit from the top of the stack) ? - if bit is true skip the next command * - jump: read a signed byte like w and jump in that direction
- Interpreter in Ruby by Martin Ender