diff options
Diffstat (limited to '')
| -rwxr-xr-x | practice | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/practice b/practice new file mode 100755 index 0000000..52f7e45 --- /dev/null +++ b/practice | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # Script based on nissy (see https://nissy.tronto.net) to practice FMC | ||
| 4 | |||
| 5 | # Usage: practice [htr|fin] | ||
| 6 | |||
| 7 | usage() { | ||
| 8 | echo "Usage: practice [htr|fin]" | ||
| 9 | } | ||
| 10 | |||
| 11 | htr() { | ||
| 12 | while true; do | ||
| 13 | scr="$(nissy scramble dr)" | ||
| 14 | echo "$scr" | ||
| 15 | read -r x | ||
| 16 | nissy solve -o htr "$scr" | ||
| 17 | read -r x | ||
| 18 | done | ||
| 19 | } | ||
| 20 | |||
| 21 | fin() { | ||
| 22 | while true; do | ||
| 23 | scr="$(nissy scramble htr)" | ||
| 24 | echo "$scr" | ||
| 25 | read -r x | ||
| 26 | nissy solve -o drslice "$scr" | ||
| 27 | read -r x | ||
| 28 | done | ||
| 29 | } | ||
| 30 | |||
| 31 | if [ -z "$1" ]; then | ||
| 32 | usage | ||
| 33 | exit 1 | ||
| 34 | fi | ||
| 35 | |||
| 36 | case "$1" in | ||
| 37 | htr) | ||
| 38 | htr | ||
| 39 | ;; | ||
| 40 | fin) | ||
| 41 | fin | ||
| 42 | ;; | ||
| 43 | *) | ||
| 44 | usage | ||
| 45 | exit 1 | ||
| 46 | ;; | ||
| 47 | esac | ||
