#[GNU dc][1], 6 (3x2)

    3z1
    0p2

Outputs `0`, `1`, `2` or `3` for each rotation.

For the `0`, `2` and `3` rotations, the `p` simply pops and prints the last number literal to have been pushed to the stack.  For the `1` rotation, the `z` pushes the current stack depth (1) to the stack, then the `p` pops and prints it.

  [1]: http://www.gnu.org/software/bc/manual/dc-1.05/