From 3e047f29fbbc84a4e707c67b346521f4f3495c16 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sat, 17 Feb 2024 08:04:27 -0800 Subject: [PATCH] Several improvements made in 2011/hou/try.sh --- 2011/hou/try.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/2011/hou/try.sh b/2011/hou/try.sh index 7dc584a93..fe3d2b189 100755 --- a/2011/hou/try.sh +++ b/2011/hou/try.sh @@ -6,20 +6,28 @@ # make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it # this way allows us to have the user specify a different compiler in an easy # way. -if [[ -z "$CC" ]]; then - CC="cc" -fi +[[ -z "$CC" ]] && CC="cc" make CC="$CC" all >/dev/null || exit 1 # clear screen after compilation so that only the entry is shown clear -echo "Observe how this one is in the code, both the equation and the answer: " 1>&2 +read -r -n 1 -p "Press any key to run: grep #define calculator hou.c|cut -f3 -d' ': " +echo 1>&2 +grep '#define calculator' hou.c|cut -f3 -d' ' +echo 1>&2 +read -r -n 1 -p "Press any key to run: grep '11/26+222/31' hou.c: " +echo 1>&2 +grep '11/26+222/31' hou.c +echo 1>&2 read -r -n 1 -p "Press any key to run: ./hou '11/26+222/31': " echo 1>&2 ./hou '11/26+222/31' echo 1>&2 +echo "What relation does the equation in the code have to do with the above" 1>&2 +echo "command?" 1>&2 +echo 1>&2 read -r -n 1 -p "Press any key to run: ./hou 'log((21701-19937)-(23209-21701))/log(2)': " echo 1>&2 @@ -45,4 +53,5 @@ echo 1>&2 read -r -n 1 -p "Press any key to run: ./hou 'a calculator expression -- see the C Code for details': " echo 1>&2 ./hou 'a calculator expression -- see the C Code for details' -echo "Now answer: what does the last one mean? Can you get it to report something else?" 1>&2 +echo "Now answer: what does the last one mean? Can you get it to report" 1>&2 +echo "something else?" 1>&2