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