Minecraft Color Decoder in 140byte.es JavaScript

Converts a Minecraft chat line to HTML.

You can use color codes in the Minecraft chat. I tried to create a parser in 140byte.es that converts a Minecraft chat line to HTML. I found two possible solutions, both 150 bytes. One with a lookup table and another with an algorithmic aproach (which I think is very cool).

Here are some things I learned while golfing this down:

Created by Thiemo Mättig in April 2012 for 140byt.es.

Show the source of this page or visit the Gist at GitHub.