aboutsummaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-05-12 14:17:53 +1200
committerTom Ryder <tom@sanctum.geek.nz>2017-05-12 14:17:53 +1200
commit00d01925da084bc7c5be00ed4e66e4aadacd2e26 (patch)
treec9eb68468e81567316afddd9b4f7cc5396f2ee4d /games
parentAdd missing word to acq(6df) (diff)
downloaddotfiles-00d01925da084bc7c5be00ed4e66e4aadacd2e26.tar.gz
dotfiles-00d01925da084bc7c5be00ed4e66e4aadacd2e26.zip
Adjust newline test in squ(6df) for correct type
Moving the '+' operator to apply to "k" rather than to "len" correctly coerces an integer type for the '<' test rather than a lexical comparison. This was failing on words longer than 10 letters.
Diffstat (limited to 'games')
-rw-r--r--games/squ.awk2
1 files changed, 1 insertions, 1 deletions
diff --git a/games/squ.awk b/games/squ.awk
index 3cf3f57a..85b0bf09 100644
--- a/games/squ.awk
+++ b/games/squ.awk
@@ -6,5 +6,5 @@
let[i - 1] = substr(str, i, 1)
for (j in let)
for (k in let)
- printf (k < len - 1) ? "%s " : "%s\n", let[(k + j) % len]
+ printf (k + 1 < len) ? "%s " : "%s\n", let[(k + j) % len]
}