11: Functions and Midnight’s Code language - NariShakti 11: Functions and Midnight’s Code language | NariShakti Humane ClubMade in Humane Club

11: Functions and Midnight’s Code language

Chp11 Functions Code

Midnight the owl really liked word games. One day, she decided to make a secret code that she could use with her friend Yoj the cat.

At recess, Midnight called Yoj  over to the bench. She took out a piece of paper and told her the idea. Yoj liked it a lot. Then, Midnight explained the code, “When we use the code, we have to reverse all the letters in a word. Then reverse the words in a sentence. When calling me, call me Sunday. When I call you, I will call you Joy.”

Luna piped up, “Let’s call this code the Opposite Ray!” Midnight said, “Awesome!!!! Now, do you want to plan a playdate?” “Sure,” Yoj  said.

They got to work. Yoj  whispered, “Opposite Ray, Sunday!” Midnight immediately responded, “Opposite Ray inaction, Joy?” Yoj said, “Ho haey! {Oh yeah!}”. Midnight smiled to herself.

They started to talk about what they should do in the playdate. Midnight decided to say, “Let’s keep it on Sunday.” This is how she reversed it:

StepsWord 1Word 2Word 3Word 4Word 5
Step 1s’telpeektinoyadnus
Step 2yadnusnotipeeks’tel

She then said, “Opposite Ray, Joy. Yadnus no ti peek s’tel.” Yoj thought, “This code is a little complicated. It is easier to just write letters in order to communicate. But I guess I’ll get used to it.”

Midnight thought, “It is so easy to just tell Yoj when to use the code. The Opposite Ray makes it nice and easy.”

Finally, their teacher, Madam Hoot, grew curious about their code language. She decided to try to decode it. Every time they said anything after saying Opposite Ray, she would note the word down on paper.

Once Madam Hoot went home, she put all those words side by side. She wrote on the top: Opposite Ray. Then it struck her. The code was right in front of her! These kids had reversed the letters and the words.

She smiled to herself.

Madam Hoot used it with Midnight by saying, “Olleh, Sunday”. Midnight calmly answered in the code language with a big grin on her face. From then on, Madam Hoot used only the Opposite Ray with Midnight and Yoj.

Things to learn: A Function is some steps, in a certain order, which are called something. Madam Hoot showed us that they can be cracked. Yoj showed us that they are only useful if it is worth using.