scripts

Various scripts for UNIX-like systems
git clone https://git.tronto.net/scripts
Download | Log | Files | Refs | README

commit b24b6b16f1f04f8f6ca54386774818c369a67041
parent 2d4d0f339ab2bfc5c0d74bd18048f96499172e85
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date:   Sun, 29 Oct 2023 12:06:09 +0100

Added practice

Diffstat:
MMakefile | 1+
Apractice | 47+++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile @@ -26,6 +26,7 @@ SCRIPTS = addressgrep \ popup-cal12 \ popup-cal3 \ popup-terminal \ + practice \ secret \ sel \ share \ diff --git a/practice b/practice @@ -0,0 +1,47 @@ +#!/bin/sh + +# Script based on nissy (see https://nissy.tronto.net) to practice FMC + +# Usage: practice [htr|fin] + +usage() { + echo "Usage: practice [htr|fin]" +} + +htr() { + while true; do + scr="$(nissy scramble dr)" + echo "$scr" + read -r x + nissy solve -o htr "$scr" + read -r x + done +} + +fin() { + while true; do + scr="$(nissy scramble htr)" + echo "$scr" + read -r x + nissy solve -o drslice "$scr" + read -r x + done +} + +if [ -z "$1" ]; then + usage + exit 1 +fi + +case "$1" in + htr) + htr + ;; + fin) + fin + ;; + *) + usage + exit 1 + ;; +esac