This is just nostalgic amusement. I recently encountered the following while poking around in some code that I had written a disturbingly long time ago:
switch (-1&3) {
case 1: ...
case 2: ...
case 3: ...
...
}
What does this code do? This is interesting because the switch expression is a constant that could be evaluated at compile time (indeed, this could just as well have been implemented with a series of #if/#elseif preprocessor directives instead of a switch-case statement).
As usual, it seems more fun to present this as a puzzle, rather than just point and say, “This is what I did.” For context, or possibly as a hint, this code was part of a task involving parsing and analyzing digital terrain elevation data (DTED), where it makes at least some sense.