"A cryptogram is a type of puzzle that consists of a short piece of encrypted text. Generally the cipher used to encrypt the text is simple enough that cryptogram can be solved by hand. Frequently used are substitution ciphers where each letter is replaced by a different letter or number. To solve the puzzle, one must recover the original lettering. Though once used in more serious applications, they are now mainly printed for entertainment in newspapers and magazines." -- Wikipedia
This is a cryptogram (aka cryptoquip in many newspapers) generator. It gathers a random set of letters and substitutes them with the original letters to create a cryptic message. It can be somewhat entertaining when you're bored. I haven't turned it into a game, but if people want to use it to turn it into one or I have enough requests to turn it into one. Just give credit if you use it for anything.
alias crypto {
var %phrase = $iif($1-, $1-, The quick brown fox jumped over the lazy dogs.)
var %alphabet = a b c d e f g h i j k l m n o p q r s t u v w x y z
while (1) {
var %n = $r(1, 26)
var %letter = $gettok(%alphabet, %n, 32)
var %crypto = $addtok(%crypto, %letter, 32)
if ($numtok(%crypto, 32) == 26) break
}
var %n = 1
while (%n <= 26) {
var %old = $gettok(%alphabet, %n, 32)
var %new = $gettok(%crypto, %n, 32)
var %oldUpper = $upper(%old)
var %newUpper = $upper(%new)
var %replace = $instok(%replace, $+(%old, $chr(44), %new, $chr(44), %oldUpper, $chr(44), %newUpper), 0, 44)
inc %n
}
msg # 14 $+ %phrase
msg # 04 $+ $replacexcs(%phrase, [ %replace ] )
}
I made something similar to this a year ago (or more, I don't remember how long it's been). Only difference is hat it didn't use a randomly generated set of letters/numbers/symbols for replacement. It was a set string for each letter/number/etc. Also a decoder. It was just for fun with a few friends when we wanted to have random conversations in the channel without anyone knowing what it was. Lol. :P Looks good though.
I have removed the following line:
else continue
I forgot to remove it when I edited it last night, because there was another small section that I changed.
Also, @Yawhatnever I don't like the way that looks, which is why I did it the way I did. No other reason. :P
Long time no see my friend.