aboutsummaryrefslogtreecommitdiff
path: root/games/drakon.awk
blob: ebca4e95968850711350a3c76295e008cfc981ba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# TyPe lIkE AnDoR DrAkOn fRoM AnCiEnT DoMaInS Of mYsTeRy
# <http://www.adomgb.info/adomgb-4.html>
{
    len = length($0)
    lin = ""
    tog = 0
    for (i = 1; i <= len; i++) {
        chr = substr($0, i, 1)
        if (chr ~ /[a-zA-Z]/)
            chr = (tog = !tog) ? tolower(chr) : toupper(chr)
        lin = lin chr
    }
    print lin
}