diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-06-19 12:46:06 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-06-19 12:46:06 +1200 |
commit | 28249853f3c77c4f50b64b4f45c2d5a2c800c34f (patch) | |
tree | abc6a0d3d2c0ab1a2a0a2f21eaf5fb747f50d684 /games/drakon.awk | |
parent | Remove user@ prefix from prompt (diff) | |
download | dotfiles-28249853f3c77c4f50b64b4f45c2d5a2c800c34f.tar.gz dotfiles-28249853f3c77c4f50b64b4f45c2d5a2c800c34f.zip |
Clean up drakon(6df) a bit
Diffstat (limited to 'games/drakon.awk')
-rw-r--r-- | games/drakon.awk | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/games/drakon.awk b/games/drakon.awk index b8d72888..ce619585 100644 --- a/games/drakon.awk +++ b/games/drakon.awk @@ -1,14 +1,14 @@ # TyPe lIkE AnDoR DrAkOn fRoM AnCiEnT DoMaInS Of mYsTeRy # <http://www.adomgb.info/adomgb-4.html> { - len = length - line = "" - toggle = 0 + len = length($0) + lin = "" + tog = 0 for (i = 1; i <= len; i++) { - char = substr($0, i, 1) - if (char ~ /[[:alpha:]]/) - char = (toggle = !toggle) ? tolower(char) : toupper(char) - line = line char + chr = substr($0, i, 1) + if (chr ~ /[[:alpha:]]/) + chr = (tog = !tog) ? tolower(chr) : toupper(chr) + lin = lin chr } - print line + print lin } |