From d6fdf14d5c320bdca455f910d58d652c5a7827da Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 17 Nov 2023 19:14:26 +0100 Subject: Simplified move and transform code --- utils/genmoveswitch.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 utils/genmoveswitch.sh (limited to 'utils/genmoveswitch.sh') diff --git a/utils/genmoveswitch.sh b/utils/genmoveswitch.sh new file mode 100755 index 0000000..cce18fc --- /dev/null +++ b/utils/genmoveswitch.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +printf '\tswitch (m) {\n' +for f in move_??_*.txt; do + t="$(echo $f | sed 's/.*_// ; s/\.txt//')" + printf '\tcase %s:\n\t\treturn _move(%s, c);\n' "$t" "$t" +done +printf '\t}\n' -- cgit v1.3