diff --git a/clow.sh b/clow.sh new file mode 100755 index 0000000..4a3c5dc --- /dev/null +++ b/clow.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +set -e +# one Card for each of the cardinals Also 4 stages of the day +draw_card() { + local C=$((RANDOM % 52 + 1)) + recsel -e "Order=$C" cards.rec | sed 's/+//g' + +} +full_reading() { + local N=$((RANDOM % 52 + 1)) + local S=$((RANDOM % 52 + 1)) + local E=$((RANDOM % 52 + 1)) + local W=$((RANDOM % 52 + 1)) + + echo -e "Your Card from the at the North/Air is" + + recsel -e "Order=$N" cards.rec | sed 's/+//g' + echo "press enter to continue" + read + clear + echo -e "Your Card at East/Water is" + recsel -e "Order=$E" cards.rec | sed 's/+//g' + read + clear + echo -e "At the South/Earth" + recsel -e "Order=$S" cards.rec | sed 's/+//g' + read + clear + echo -e "Finally at the West/Fire" + recsel -e "Order=$W" cards.rec | sed 's/+//g' + read + clear +} +cleanup_exit() { + + echo "have a magical day" + echo "Press enter to exit" + echo -e "\033[0m" + read + clear + exit + +} +echo -e "\033[37;44m" +clear +echo -e "You have opened the book of the Clow" +while true; do + read -r -p "Menu: Draw/Reading/Quit " answer + case $answer in + [Dd]*) + draw_card + continue + ;; + [Rr]*) + full_reading + continue + ;; + [Qq]*) cleanup_exit ;; + *) echo "Valid Choices are D/R/Q." ;; + esac +done diff --git a/reading.sh b/reading.sh deleted file mode 100755 index 402063e..0000000 --- a/reading.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -set -e -# one Card for each of the cardinals Also 4 stages of the day -N=$((RANDOM % 52 + 1)) -S=$((RANDOM % 52 + 1)) -E=$((RANDOM % 52 + 1)) -W=$((RANDOM % 52 + 1)) - -echo -e "Your Card from the at the North/Air is" - -recsel -e "Order=$N" cards.rec | sed 's/+//g' -echo "press enter to continue" -read -clear -echo -e "Your Card at East/Water is" -recsel -e "Order=$E" cards.rec | sed 's/+//g' -read -clear -echo -e "At the South/Earth" -recsel -e "Order=$S" cards.rec | sed 's/+/ /g' -read -clear -echo -e "Finally at the West/Fire" -recsel -e "Order=$W" cards.rec | sed 's/+/ /g' -read -clear - -echo "have a magical day"