commit 59b072e40cfdca71d55603d734d81fbbee61d3be
parent ea728414593d3d13c7f9a9fd125ab02d2eb2881e
Author: Luxferre <lux@ferre>
Date: Tue, 16 Jan 2024 14:36:25 +0200
Now autohoming by default, use -v NAH=1 to disable
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/nnfc.awk b/nnfc.awk
@@ -1,5 +1,5 @@
# no-nonsense FreeCell in POSIX AWK
-# run as: [n]awk -f nnfc.awk [-v ASCII=1] [-v MONOCHROME=1] [-v SEED=x]
+# run as: [n]awk -f nnfc.awk [-v ASCII=1] [-v MONOCHROME=1] [-v SEED=x] [-v NAH=1]
# commands: q - quit, u - undo, ah - autohome, h - help,
# [number][number] - move from column/freecell to column/freecell/foundation:
# - 0 is foundation (can be omitted)
@@ -197,6 +197,7 @@ function help() {
print "-v ASCII=1\tuse ASCII instead of Unicode suit chars"
print "-v MONOCHROME=1\t don't use colors"
print "-v SEED=xxxxx\tset game seed number (M$-compatible)"
+ print "-v NAH=1\tdisable autohoming after every move (use ah command for this)"
print "Commands: q - quit, u - undo, ah - autohome, h - this help"
print "Moves: [digit][digit], where \"digits\" are:"
print "- 0 is foundation (can be omitted)"
@@ -275,6 +276,7 @@ BEGIN { # main code part
else { # pass the command to the logic function
res = domove(cmd)
if(res == 0) print "Invalid move!"
+ else if(NAH != 1 && res < 2) res = autohome()
}
render()
if(res == 2) {print "Victory!"; break}