A Ruby port of the PHP MonsterId script.