l=(champagne neighbor tortoise);clear;s="espeak -v en-us -a 200";for i in ${l[@]};do$s$i;read w;if["$w"="$i"];then$s"Got it!";elsec=0;while[$c -lt ${#i}];do$s${i:$c:1};((c++));done;fi;done&> /dev/null
}
math_game(){
#Simple configurable math game, change o for different types, set n min and x max numbers used.
n=0;x=10;o=+;m=0;r=0;s=5;t=0;a=-;while["${a^}" !="Q"];dop="$(shuf -n1 -i$n-$x)$o$(shuf -n1 -i$n-$x)";read -t$s -p "$p" a;if[$a -eq $(($p))];thenecho"Yay!";((r++));s=$(echo"scale=2;$s-0.05"| bc);elseecho"Wrong: $(($p))";((m++));fi 2> /dev/null;((t++));done;echo -e "\n$r right and $(($m-1)) missed of $(($t-1)) total."
}
pig(){
#Pig dice game. any letter to roll, space or enter to bank.
c=0;p=0;s=0;t=$(shuf -n1 -e c p);while[$c -lt 100 -a $p -lt 100];doif[$t= c ];thena=$(shuf -n1 -i0-6);case$a in 0)c=$(($c+$s));s=0;t=p;echo"CPU banked $c.";;1)echo"CPU Pigged\!";s=0;t=p;;*)s=$(($s+$a));echo"CPU $s : $c";esac;elseread -n1 -p "? " a;if[ -z $a];thent=c;p=$(($s+$p));echo"You banked $p.";s=0;elsea=$(shuf -n1 -i1-6);if[$a -eq 1];thens=0;t=c;echo"You Pigged\!";elses=$(($s+$a));echo"You $s : $p";fi;fi;fi;done;echo"CPU $c : You $p"
}
helecopter(){
#Shoot down the helecopter you hear when sound is centered. Random speeds.
h=0;n=1;s=20;while[$n -eq 1];dox=9;y=0;while[$x -gt 0];do espeak --stdout [[schXh | play -qV0 - norm remix v0.$x v0.$y&read -st0.$s -n1 p;[ -n "$p"]&&if[$x -eq 5 -a $y -eq 4 -o $x -eq 4 -a $y -eq 5];thenx=9;y=0;play -nqV0 synth pi fade h 011 pad 01 reverb overdrive riaa speed 32 repeat 2;play -nqV0 synth pi fade h 011 norm -18 pad 01 reverb overdrive riaa;((h++));s=$(seq 10 20|shuf -n1);elsen=0;fi;((x--));((y++));done;done;echo"$h kills."