Created
August 25, 2018 09:27
-
-
Save xdamman/6d7c3efc01797cdb60719fcd3af0417c to your computer and use it in GitHub Desktop.
Simple program to add two numbers and say them for my 5 y/o daughter.
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
run() { | |
Q1="Enter a first number:" | |
echo $Q1 | |
say $Q1 | |
read A | |
say $A | |
Q2="Enter a second number $1:" | |
echo $Q2 | |
say $Q2 | |
read B | |
say $B | |
RES=$(($A+$B)) | |
echo "Result:" | |
ANSWER="$A + $B = $RES" | |
echo $ANSWER | |
say $ANSWER | |
say "Did you know that $1?" | |
sleep 1 | |
echo "" | |
say "Play again!" | |
run $1 | |
} | |
Q1="What is your name?" | |
echo $Q1 | |
say $Q1 | |
read NAME | |
A1="Nice to meet you $NAME!" | |
echo $A1 | |
say $A1 | |
echo "" | |
run $NAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had to prepend this to make it work on Linux:
And install http://espeak.sourceforge.net/ (
apt-get install espeak
orpacman install espeak
or ...)