diff options
| author | joott <joshott16@gmail.com> | 2025-10-23 07:58:23 -0400 |
|---|---|---|
| committer | joott <joshott16@gmail.com> | 2025-10-23 07:58:23 -0400 |
| commit | 6bda2d2a64d0a934bc324788c81768ce99338617 (patch) | |
| tree | 7fe40b335b68cc2fffe5a2f05222a67e589b9e52 /ration | |
| parent | 790d81829dfe7f74fc185fb87a5ad054fd6ecdb6 (diff) | |
| download | bin-6bda2d2a64d0a934bc324788c81768ce99338617.tar.gz bin-6bda2d2a64d0a934bc324788c81768ce99338617.zip | |
added resistance
Diffstat (limited to 'ration')
| -rwxr-xr-x | ration | 33 |
1 files changed, 27 insertions, 6 deletions
@@ -1,5 +1,6 @@ #!/usr/bin/env bash + # # the world wide web is a mischievous rat which aims to control you # this script serves to ration the rat @@ -7,12 +8,12 @@ # echo -e "\n\ - ██████╗ █████╗ ████████╗██╗ ██████╗ ███╗ ██╗\n\ - ██╔══██╗██╔══██╗╚══██╔══╝██║██╔═══██╗████╗ ██║\n\ - ██████╔╝███████║ ██║ ██║██║ ██║██╔██╗ ██║\n\ - ██╔══██╗██╔══██║ ██║ ██║██║ ██║██║╚██╗██║\n\ - ██║ ██║██║ ██║ ██║ ██║╚██████╔╝██║ ╚████║\n\ - ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝\n" + ██████╗ █████╗ ████████╗██╗ ██████╗ ███╗ ██╗\n\ + ██╔══██╗██╔══██╗╚══██╔══╝██║██╔═══██╗████╗ ██║\n\ + ██████╔╝███████║ ██║ ██║██║ ██║██╔██╗ ██║\n\ + ██╔══██╗██╔══██║ ██║ ██║██║ ██║██║╚██╗██║\n\ + ██║ ██║██║ ██║ ██║ ██║╚██████╔╝██║ ╚████║\n\ + ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝\n" SHARE=$HOME/.local/share/rat @@ -34,9 +35,29 @@ yn_prompt () { done } +generate_words () { + echo "$(shuf -n 10 /usr/share/dict/wordle | tr '\n' ' ' | sed -e 's/ $//')" +} + +rand_prompt () { + unset response + echo "# $1" + while true; do + read -p "> " response + case $response in + $1) break ;; + *) echo ERR; rand_prompt "$1"; break ;; + esac + done +} + for_duration () { unset choice duration + words="$(generate_words)" + echo "repeat after me:" + rand_prompt "$words" + while ! [[ "$duration" =~ ^[0-9]+$ ]]; do echo -n "enter duration in minutes: " read duration |