wow, thanks for the excellent example of using case statements.
Do you happen to know if C compilers optimize switch/case so that this would run as fast as a look-up table array?