Front / Back (click to flip)
Click card to view front/back
Raw Script
#!/usr/bin/env bash
set +e
tt="/dev/tty";[[ -r "$tt" && -w "$tt" ]]||tt=""
p(){ [[ -n "$tt" ]]&&printf "%b" "$1" >"$tt"||printf "%b" "$1"; }
r(){ local t=""; if [[ -n "$tt" ]]; then IFS= read -r t <"$tt" || t=""; else IFS= read -r t || t=""; fi; printf "%s" "$t"; }
W=60
deck="EDU";subject="EDU";
topic="Biology as a Science";
subtitle="Understanding Life and Scientific Skills";
note="Biology helps learners of all ages explore life and develop scientific skills by connecting ideas with hands-on activities, making science both understandable and exciting.";
cl(){ printf "\033[2J\033[H"; }
bar(){ printf "%s\n" "$(printf "%*s" "$W" "" | tr " " "=")"; }
row(){ printf "| %-*.*s |\n" "$((W-4))" "$((W-4))" "$1"; }
wrap(){
local txt="$1" max=$((W-4)) chunk rest cut
while [[ -n "$txt" ]]; do
if [[ ${#txt} -le $max ]]; then row "$txt"; break; fi
chunk=${txt:0:$max}
rest=${txt:$max}
if [[ "$chunk" =~ (.+)[[:space:]] ]]; then
cut=${BASH_REMATCH[1]}
row "$cut"
txt="${txt:${#cut}}"; txt="${txt#" "}";
else
row "$chunk"
txt="$rest"
fi
done
}
pause(){ p "Press Enter to continue: "; r >/dev/null; }
menu(){
cl
bar; row "$deck • $subject"; bar
wrap "$topic"
wrap "$subtitle"
if [[ -n "$note" ]]; then wrap "Tip: $note"; fi
bar
row "1) OVERVIEW"
row "2) STEPS"
row "3) TERMINOLOGY"
row "q) EXIT"
bar
p "> "
}
page_OVERVIEW(){
cl
bar; row "OVERVIEW"; bar
local s
p=(
"Biology studies living organisms and life processes."
"It explores life from molecules to ecosystems."
"Learners develop observation and experimentation skills."
"Critical thinking and problem-solving are key focuses."
"Core concepts include cells, genetics, evolution, and ecology."
"Biology links theory with practical investigations."
)
for s in "${p[@]}"; do wrap "$s"; done
bar
pause
}
page_STEPS(){
cl
bar; row "STEPS"; bar
local s
p=(
"Introduce the diversity of living organisms and their environments."
"Explain cell structure and function as the basis of life."
"Explore genetics and heredity through simple experiments."
"Discuss evolution and natural selection with examples."
"Investigate ecosystems and the interactions within them."
"Connect biology concepts to health, environment, and technology."
)
for s in "${p[@]}"; do wrap "$s"; done
bar
pause
}
page_TERMINOLOGY(){
cl
bar; row "TERMINOLOGY"; bar
local s
p=(
"Cell — the basic unit of life in all living organisms"
"Genetics — the study of heredity and gene function"
"Evolution — the process by which species change over time"
"Ecology — the study of interactions between organisms and their environment"
"Observation — carefully noticing and recording details"
"Experimentation — testing ideas through controlled procedures"
"Hypothesis — an educated guess to be tested"
"Biotechnology — using biological processes for practical purposes"
)
for s in "${p[@]}"; do wrap "$s"; done
bar
pause
}
while true; do
menu
read -r choice < "${tt:-/dev/stdin}" || choice=""
case "$choice" in
1) page_OVERVIEW ;;
2) page_STEPS ;;
3) page_TERMINOLOGY ;;
q|Q) cl; bar; row "CARD CLOSED"; bar; p "\n"; break ;;
*) cl; bar; row "Select 1-3 or q"; bar; pause ;;
esac
done
QR Payload
#!/usr/bin/env bash
set -euo pipefail;bash -c $'set +e\ntt="/dev/tty";[[ -r "$tt" && -w "$tt" ]]||tt=""\np(){ [[ -n "$tt" ]]&&printf "%b" "$1" >"$tt"||printf "%b" "$1"; }\nr(){ local t=""; if [[ -n "$tt" ]]; then IFS= read -r t <"$tt" || t=""; else IFS= read -r t || t=""; fi; printf "%s" "$t"; }\nW=60\ndeck="EDU";subject="EDU";\ntopic="Biology as a Science";\nsubtitle="Understanding Life and Scientific Skills";\nnote="Biology helps learners of all ages explore life and develop scientific skills by connecting ideas with hands-on activities, making science both understandable and exciting.";\ncl(){ printf "\\033[2J\\033[H"; }\nbar(){ printf "%s\\n" "$(printf "%*s" "$W" "" | tr " " "=")"; }\nrow(){ printf "| %-*.*s |\\n" "$((W-4))" "$((W-4))" "$1"; }\nwrap(){\n local txt="$1" max=$((W-4)) chunk rest cut\n while [[ -n "$txt" ]]; do\n if [[ ${#txt} -le $max ]]; then row "$txt"; break; fi\n chunk=${txt:0:$max}\n rest=${txt:$max}\n if [[ "$chunk" =~ (.+)[[:space:]] ]]; then\n cut=${BASH_REMATCH[1]}\n row "$cut"\n txt="${txt:${#cut}}"; txt="${txt#" "}";\n else\n row "$chunk"\n txt="$rest"\n fi\n done\n}\npause(){ p "Press Enter to continue: "; r >/dev/null; }\nmenu(){\n cl\n bar; row "$deck • $subject"; bar\n wrap "$topic"\n wrap "$subtitle"\n if [[ -n "$note" ]]; then wrap "Tip: $note"; fi\n bar\n row "1) OVERVIEW"\n row "2) STEPS"\n row "3) TERMINOLOGY"\n row "q) EXIT"\n bar\n p "> "\n}\npage_OVERVIEW(){\n cl\n bar; row "OVERVIEW"; bar\n local s\n p=(\n"Biology studies living organisms and life processes."\n"It explores life from molecules to ecosystems."\n"Learners develop observation and experimentation skills."\n"Critical thinking and problem-solving are key focuses."\n"Core concepts include cells, genetics, evolution, and ecology."\n"Biology links theory with practical investigations."\n)\n for s in "${p[@]}"; do wrap "$s"; done\n bar\n pause\n}\npage_STEPS(){\n cl\n bar; row "STEPS"; bar\n local s\n p=(\n"Introduce the diversity of living organisms and their environments."\n"Explain cell structure and function as the basis of life."\n"Explore genetics and heredity through simple experiments."\n"Discuss evolution and natural selection with examples."\n"Investigate ecosystems and the interactions within them."\n"Connect biology concepts to health, environment, and technology."\n)\n for s in "${p[@]}"; do wrap "$s"; done\n bar\n pause\n}\npage_TERMINOLOGY(){\n cl\n bar; row "TERMINOLOGY"; bar\n local s\n p=(\n"Cell — the basic unit of life in all living organisms"\n"Genetics — the study of heredity and gene function"\n"Evolution — the process by which species change over time"\n"Ecology — the study of interactions between organisms and their environment"\n"Observation — carefully noticing and recording details"\n"Experimentation — testing ideas through controlled procedures"\n"Hypothesis — an educated guess to be tested"\n"Biotechnology — using biological processes for practical purposes"\n)\n for s in "${p[@]}"; do wrap "$s"; done\n bar\n pause\n}\nwhile true; do\n menu\n read -r choice < "${tt:-/dev/stdin}" || choice=""\n case "$choice" in\n 1) page_OVERVIEW ;;\n 2) page_STEPS ;;\n 3) page_TERMINOLOGY ;;\n q|Q) cl; bar; row "CARD CLOSED"; bar; p "\\n"; break ;;\n *) cl; bar; row "Select 1-3 or q"; bar; pause ;;\n esac\ndone\n'