aboutsummaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-05-01 21:47:15 +1200
committerTom Ryder <tom@sanctum.geek.nz>2017-05-01 21:47:15 +1200
commitc31338baca39b5a545ce307327fea2fefb9ed99e (patch)
tree85a2082f310699df3575c453ecfe71e5a95f3024 /games
parentUpdate documentation URLs (diff)
downloaddotfiles-c31338baca39b5a545ce307327fea2fefb9ed99e.tar.gz
dotfiles-c31338baca39b5a545ce307327fea2fefb9ed99e.zip
Add squ(6df)
Diffstat (limited to 'games')
-rw-r--r--games/squ.awk10
1 files changed, 10 insertions, 0 deletions
diff --git a/games/squ.awk b/games/squ.awk
new file mode 100644
index 00000000..0d8f9210
--- /dev/null
+++ b/games/squ.awk
@@ -0,0 +1,10 @@
+# Make a square out of each line of input
+{
+ str = toupper($0)
+ len = length(str)
+ for (i = 1; i <= len; i++)
+ 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]
+}