RL is a valid scramble, and this scrambler doesn't seem to allow that. I'll leave you to figure that one out :P.
The structure of the code is fine though, and interesting way of keeping track of the axis.
Also, instead of using a switch statement, you can use an array and have the index be a...