From 6fae25b305d714b3ab7608fa003f1af9bf024545 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Tue, 14 Feb 2023 13:33:23 +0800 Subject: Rename tools into bin --- tools/misc/flash.sh | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100755 tools/misc/flash.sh (limited to 'tools/misc/flash.sh') diff --git a/tools/misc/flash.sh b/tools/misc/flash.sh deleted file mode 100755 index 93ce8fd..0000000 --- a/tools/misc/flash.sh +++ /dev/null @@ -1,39 +0,0 @@ -#! /bin/bash - -while true; do - CARDS="$(cat ~/log/flashcards.md | shuf | head -5)" - CARD="$(<<<"$CARDS" sed -n 3p)" - - # Print the Question - <<<"$CARD" tr -s '\t' | cut -f1 - echo - tput bold; tput setaf 1 - <<<"$CARDS" tr -s '\t' | cut -f2 | tr '\n' '\t' - tput sgr0 - echo - echo - echo ---- - echo - - # Get the User Input - read -er INPUT - - # Print the Answer - ANSER=$(<<<"$CARD" tr -s '\t' | cut -f2) - echo - echo ---- - echo - - # If answer correctly, print the checked box - if [[ "$INPUT" == "$ANSER" ]]; then - tput setaf 2 - echo '☑' - tput setaf 7 - else - echo $ANSER - fi - - echo - read - tput clear -done -- cgit v1.2.3-70-g09d2