Improve 2000/natori/try.sh

This commit is contained in:
Cody Boone Ferguson committed 2024-01-19 09:09:57 -08:00
1 parent 54ef14bbde
commit 6252e3c692
1 file changed
+23 -8
+23 -8
View File
@@ -19,12 +19,15 @@ NATORI="natori"
moon() moon()
{ {
read -r -n 1 -p "Press any key to randomly show the northern/southern hemisphere Moon: " read -r -n 1 -p "Press any key to randomly show the northern/southern hemisphere Moon: "
echo 1>&2
for ((i=0;i<=10;i++)); do for ((i=0;i<=10;i++)); do
RAND=$((RANDOM % 1000)) RAND=$((RANDOM % 1000))
if [[ "$RAND" -le 500 ]]; then if [[ "$RAND" -le 500 ]]; then
./"$NATORI" ./"$NATORI"
echo 1>&2
else else
./"$NATORI".alt ./"$NATORI".alt
echo 1>&2
fi fi
done done
@@ -32,6 +35,7 @@ moon()
RAND=$((RANDOM % 1000)) RAND=$((RANDOM % 1000))
if [[ "$RAND" -gt 500 ]]; then if [[ "$RAND" -gt 500 ]]; then
read -r -n 1 -p "Press any key to alternate between the northern/southern hemisphere Moon: " read -r -n 1 -p "Press any key to alternate between the northern/southern hemisphere Moon: "
echo 1>&2
./"$NATORI" ./"$NATORI"
./"$NATORI".alt ./"$NATORI".alt
./"$NATORI" ./"$NATORI"
@@ -40,6 +44,7 @@ moon()
./"$NATORI".alt ./"$NATORI".alt
else else
read -r -n 1 -p "Press any key to alternate between the southern/northern hemisphere Moon: " read -r -n 1 -p "Press any key to alternate between the southern/northern hemisphere Moon: "
echo 1>&2
./"$NATORI".alt ./"$NATORI".alt
./"$NATORI" ./"$NATORI"
./"$NATORI".alt ./"$NATORI".alt
@@ -54,6 +59,7 @@ moon()
if [[ "$RAND" -le 499 ]]; then if [[ "$RAND" -le 499 ]]; then
read -r -n 1 -p "Press any key to alternate between the northern/southern hemisphere Moon: " read -r -n 1 -p "Press any key to alternate between the northern/southern hemisphere Moon: "
echo 1>&2
./"$NATORI" ./"$NATORI"
./"$NATORI".alt ./"$NATORI".alt
./"$NATORI" ./"$NATORI"
@@ -62,6 +68,7 @@ moon()
./"$NATORI".alt ./"$NATORI".alt
else else
read -r -n 1 -p "Press any key to alternate between the southern/northern hemisphere Moon: " read -r -n 1 -p "Press any key to alternate between the southern/northern hemisphere Moon: "
echo 1>&2
./"$NATORI".alt ./"$NATORI".alt
./"$NATORI" ./"$NATORI"
./"$NATORI".alt ./"$NATORI".alt
@@ -77,12 +84,14 @@ moon()
RAND=$((RANDOM % 1000)) RAND=$((RANDOM % 1000))
if [[ "$RAND" -gt 500 ]]; then if [[ "$RAND" -gt 500 ]]; then
read -r -n 1 -p "Press any key to alternate between the northern/southern hemisphere Moon: " read -r -n 1 -p "Press any key to alternate between the northern/southern hemisphere Moon: "
echo 1>&2
( ./"$NATORI"; ./"$NATORI.alt" ; ./"$NATORI" ; ./"$NATORI.alt"; \ ( ./"$NATORI"; ./"$NATORI.alt" ; ./"$NATORI" ; ./"$NATORI.alt"; \
./"$NATORI"; ./"$NATORI.alt" ) | less ./"$NATORI"; ./"$NATORI.alt" ) | less -rEXF
else else
read -r -n 1 -p "Press any key to alternate between the southern/northern hemisphere Moon: " read -r -n 1 -p "Press any key to alternate between the southern/northern hemisphere Moon: "
echo 1>&2
( ./"$NATORI.alt"; ./"$NATORI" ; ./"$NATORI.alt" ; ./"$NATORI"; \ ( ./"$NATORI.alt"; ./"$NATORI" ; ./"$NATORI.alt" ; ./"$NATORI"; \
./"$NATORI.alt"; ./"$NATORI" ) | less ./"$NATORI.alt"; ./"$NATORI" ) | less -rEXF
fi fi
echo 1>&2 echo 1>&2
@@ -91,12 +100,14 @@ moon()
echo 1>&2 echo 1>&2
if [[ "$RAND" -gt 500 ]]; then if [[ "$RAND" -gt 500 ]]; then
read -r -n 1 -p "Press any key to alternate between the northern/southern hemisphere Moon: " read -r -n 1 -p "Press any key to alternate between the northern/southern hemisphere Moon: "
echo 1>&2
( ./"$NATORI"; ./"$NATORI.alt" ; ./"$NATORI" ; ./"$NATORI.alt"; \ ( ./"$NATORI"; ./"$NATORI.alt" ; ./"$NATORI" ; ./"$NATORI.alt"; \
./"$NATORI"; ./"$NATORI.alt" ) | less ./"$NATORI"; ./"$NATORI.alt" ) | less -rEXF
else else
read -r -n 1 -p "Press any key to alternate between the southern/northern hemisphere Moon: " read -r -n 1 -p "Press any key to alternate between the southern/northern hemisphere Moon: "
echo 1>&2
( ./"$NATORI.alt"; ./"$NATORI" ; ./"$NATORI.alt" ; ./"$NATORI"; \ ( ./"$NATORI.alt"; ./"$NATORI" ; ./"$NATORI.alt" ; ./"$NATORI"; \
./"$NATORI.alt"; ./"$NATORI" ) | less ./"$NATORI.alt"; ./"$NATORI" ) | less -rEXF
fi fi
echo 1>&2 echo 1>&2
@@ -107,12 +118,14 @@ moon()
echo 1>&2 echo 1>&2
if [[ "$RAND" -le 499 ]]; then if [[ "$RAND" -le 499 ]]; then
read -r -n 1 -p "Press any key to alternate between the northern/southern hemisphere Moon: " read -r -n 1 -p "Press any key to alternate between the northern/southern hemisphere Moon: "
echo 1>&2
( ./"$NATORI"; ./"$NATORI.alt" ; ./"$NATORI" ; ./"$NATORI.alt"; \ ( ./"$NATORI"; ./"$NATORI.alt" ; ./"$NATORI" ; ./"$NATORI.alt"; \
./"$NATORI"; ./"$NATORI.alt" ) | less ./"$NATORI"; ./"$NATORI.alt" ) | less -rEXF
else else
read -r -n 1 -p "Press any key to alternate between the southern/northern hemisphere Moon: " read -r -n 1 -p "Press any key to alternate between the southern/northern hemisphere Moon: "
echo 1>&2
( ./"$NATORI.alt"; ./"$NATORI" ; ./"$NATORI.alt" ; ./"$NATORI"; \ ( ./"$NATORI.alt"; ./"$NATORI" ; ./"$NATORI.alt" ; ./"$NATORI"; \
./"$NATORI.alt"; ./"$NATORI" ) | less ./"$NATORI.alt"; ./"$NATORI" ) | less -rEXF
fi fi
echo 1>&2 echo 1>&2
@@ -121,12 +134,14 @@ moon()
echo 1>&2 echo 1>&2
if [[ "$RAND" -le 499 ]]; then if [[ "$RAND" -le 499 ]]; then
read -r -n 1 -p "Press any key to alternate between the northern/southern hemisphere Moon: " read -r -n 1 -p "Press any key to alternate between the northern/southern hemisphere Moon: "
echo 1>&2
( ./"$NATORI"; ./"$NATORI.alt" ; ./"$NATORI" ; ./"$NATORI.alt"; \ ( ./"$NATORI"; ./"$NATORI.alt" ; ./"$NATORI" ; ./"$NATORI.alt"; \
./"$NATORI"; ./"$NATORI.alt" ) | less ./"$NATORI"; ./"$NATORI.alt" ) | less -rEXF
else else
read -r -n 1 -p "Press any key to alternate between the southern/northern hemisphere Moon: " read -r -n 1 -p "Press any key to alternate between the southern/northern hemisphere Moon: "
echo 1>&2
( ./"$NATORI.alt"; ./"$NATORI" ; ./"$NATORI.alt" ; ./"$NATORI"; \ ( ./"$NATORI.alt"; ./"$NATORI" ; ./"$NATORI.alt" ; ./"$NATORI"; \
./"$NATORI.alt"; ./"$NATORI" ) | less ./"$NATORI.alt"; ./"$NATORI" ) | less -rEXF
fi fi
echo 1>&2 echo 1>&2
} }