Bored this Friday morning? Here is a little treat for you. Write a ColdFusion UDF that does the following:

  1. Takes a string as input.
  2. Converts every letter (ignoring spaces, numbers, or anything not a letter) into code using letter-substitution. In other words, A is equals to some random other letter, like X (and conversely, X is equal to A).
  3. The UDF should return the converted string, and a struct where each key is letter of the alphabet and the coded version.

Basically you are building a tool that would let you create simple letter-substitution puzzles. This is not a contest. I'm not judging anything. This is just for fun. If it takes you more than five minutes to write it - stop - you lost. Don't worry about it. When you get your solution, either paste your code into the comments or just share a URL.