RosettaCodeData/Task/Vigen-re-cipher/Icon/vigen-re-cipher-2.icon
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

13 lines
566 B
Text

link strings
procedure NormalizeText(ptext,alpha) #: text/case classical crypto helper
/alpha := &ucase # default
if &lcase === (alpha := cset(alpha)) then ptext := map(ptext) # lower
if &ucase === alpha then ptext := map(ptext,&lcase,&ucase) # upper
return deletec(ptext,&cset--alpha) # only alphas
end
procedure GFormat(text) #: 5 letter group formatting helper
text ? (s := "", until pos(0) do s ||:= " " || move(5)|tab(0))
return s[2:0]
end