Created
February 20, 2023 15:02
-
-
Save Sea-n/63d67f15ec240f4a829a5a4648effbaf to your computer and use it in GitHub Desktop.
French number practice
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
cd "$(dirname "$0")" || exit 1 | |
main() { | |
while true; do | |
ans="$((16#$(openssl rand -hex 4) % 101))" | |
echo -n " > " | |
say -v Thomas "$ans" | |
say -v Amélie "$ans" | |
read -r guess | |
while [[ "$guess" != "$ans" ]]; do | |
echo -n "Try again > " | |
say -v Amélie "C'est $ans, pas $guess" | |
say -v Thomas "$((ans - 1)), $ans, $((ans + 1))" | |
read -r guess | |
done | |
done | |
} | |
main "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment