Template:Switch

This template is the functional equivalent of a switch-case statement in programming languages like JavaScript and C++, with the exception that it doesn't support fall-through. It was taken from Wikipedia.

If this wiki ever gets ParserFunctions, this template will be rendered obsolete, but until then, it's an effective way to get a switch-case statement. Here's an example of its use:

The code above takes the current day of the week (which is stored as an integer) and translates it into a human-readable string of text.