-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsilly_learning_adventure.sh
More file actions
executable file
Β·136 lines (119 loc) Β· 4.13 KB
/
silly_learning_adventure.sh
File metadata and controls
executable file
Β·136 lines (119 loc) Β· 4.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#!/bin/bash
# π The Silly Learning Adventure - Where Education Meets Chaos
# Brought to you by Captain Rattlecode's School of Accidental Knowledge
echo "πͺ Welcome to the FRAGLE ACADEMY OF ABSURD LEARNING!"
echo "=================================================="
echo ""
sleep 1
# Lesson 1: Variables
echo "π LESSON 1: Variables (or 'Magic Boxes That Remember Stuff')"
echo "-----------------------------------------------------------"
FAVORITE_COOKIE="Chocolate Chip"
STUDENT_NAME="Brave Code Warrior"
MAGIC_NUMBER=$((RANDOM % 100))
echo "π Hello, $STUDENT_NAME!"
echo "πͺ Your favorite cookie is: $FAVORITE_COOKIE"
echo "π² Your lucky number today is: $MAGIC_NUMBER"
echo ""
sleep 2
# Lesson 2: Loops
echo "π LESSON 2: Loops (or 'Doing Boring Stuff Without Getting Bored')"
echo "----------------------------------------------------------------"
echo "Let's count cookies!"
for i in {1..5}; do
echo "πͺ Cookie #$i - Yum!"
sleep 0.5
done
echo "π We counted $i cookies. Now we're hungry."
echo ""
sleep 2
# Lesson 3: Conditionals
echo "π LESSON 3: If/Then/Else (or 'Making Decisions Like a Robot')"
echo "------------------------------------------------------------"
CURRENT_HOUR=$(date +%H)
echo "β° Current hour: $CURRENT_HOUR"
if [ "$CURRENT_HOUR" -lt 12 ]; then
echo "π
Good morning! Time for debugging with coffee!"
elif [ "$CURRENT_HOUR" -lt 18 ]; then
echo "βοΈ Good afternoon! Time for more debugging with snacks!"
else
echo "π Good evening! Time for late-night coding and pizza!"
fi
echo ""
sleep 2
# Lesson 4: Arrays
echo "π LESSON 4: Arrays (or 'A List of Things That Sound Fancy')"
echo "----------------------------------------------------------"
CREW=("Captain Rattlecode" "Gumball the Whisperer" "Bobby Blip" "YELLER" "Dennis")
echo "π Meet the Fragle Crew:"
for member in "${CREW[@]}"; do
echo " β¨ $member"
sleep 0.3
done
echo ""
sleep 2
# Lesson 5: Functions
echo "π LESSON 5: Functions (or 'Reusable Magic Spells')"
echo "-------------------------------------------------"
function tell_joke() {
local jokes=(
"Why do programmers prefer dark mode? Because light attracts bugs! π"
"How many programmers does it take to change a lightbulb? None, that's a hardware problem! π‘"
"Why do Java developers wear glasses? Because they can't C#! π"
"What's a pirate's favorite programming language? RRRRuby! π΄ββ οΈ"
)
local random_joke=${jokes[$RANDOM % ${#jokes[@]}]}
echo "π $random_joke"
}
echo "π€ Here's a programming joke:"
tell_joke
echo ""
sleep 2
# Final Quiz
echo "π― FINAL QUIZ: Are You Ready?"
echo "============================"
echo ""
QUIZ_SCORE=0
echo "Question 1: What do cookies taste like in bash?"
echo "A) Chocolate B) Binary C) Variables"
read -t 10 -p "Your answer (A/B/C): " answer1
if [[ "$answer1" =~ ^[Cc]$ ]]; then
echo "β
Correct! Cookies are variables in our world!"
((QUIZ_SCORE++))
else
echo "β Nope! But nice try. Cookies are variables here!"
fi
echo ""
sleep 1
echo "Question 2: What does 'YELLER' probably do?"
echo "A) Whispers B) Types quietly C) YELLS!"
read -t 10 -p "Your answer (A/B/C): " answer2
if [[ "$answer2" =~ ^[Cc]$ ]]; then
echo "β
CORRECT! YELLER DEFINITELY YELLS! π’"
((QUIZ_SCORE++))
else
echo "β Wrong! YELLER ALWAYS YELLS! π"
fi
echo ""
sleep 1
# Results
echo "π GRADUATION RESULTS"
echo "===================="
echo "π Your score: $QUIZ_SCORE/2"
echo ""
if [ "$QUIZ_SCORE" -eq 2 ]; then
echo "π PERFECT SCORE! You're now a Certified Fragle Scholar!"
echo "π
You earned: The Golden Cookie of Wisdom"
elif [ "$QUIZ_SCORE" -eq 1 ]; then
echo "π Not bad! You're a Fragle Apprentice!"
echo "π₯ You earned: The Silver Ping of Promise"
else
echo "π
Keep learning! You're a Fragle Newbie (but that's okay!)"
echo "π₯ You earned: The Bronze Bug of Bravery"
fi
echo ""
echo "β¨ Remember: Every bug is just a feature in disguise!"
echo "π Now go forth and code with confidence (and cookies)!"
echo ""
echo "πͺ Thank you for attending the Fragle Academy!"
echo "=================================================="