DuncanDecode.frink

Download or view DuncanDecode.frink in plain text format


// Decode a sample code from Duncan McKenzie.

key = """
aa A   ae B   ai C   ao D    au E
ea F   ee G   ei H   eo I/J  eu K
ia L   ie M   ii N   io O    iu P
oa Q   oe R   oi S   oo T    ou U
ua V   ue W   ui X   uo Y    uu Z"""

// Turn the decryption key into a dictionary.  Showing off a bit.
digraphs = new dict[key =~ %r/([a-z]{2}) ([A-Z\/])/gm]

cryptext = """
On October eighth, I'll meet you for dinner if schedule allows. But no
wine, or I may have real regrets afterwards! Just let someone know which
place best appeals - but must know quickly. Joan thinks I have no more
money left (dining account fund) but she left out some old invoices for
restaurant and bar accounts, which "limits" us to a piggish binge of
infinite extent. I must go - rushing off on calls. Use your email."""

for [v1, v2] = cryptext =~ %r/\b[^aeiou]*([aeiou]).*?\b[^aeiou]*([aeiou])/gim
   print[digraphs@lc["$v1$v2"]]


Download or view DuncanDecode.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 19966 days, 23 hours, 7 minutes ago.