8.15.2020

Alex Rosenthal : Think Like A Coder, Ep 1- Ep 3

Alex Rosenthal·TED-Ed

The Prison Break | Think Like A Coder, Ep 1

Summary

I've watched Ep9 by chance before watching Ep1. In the 9, a human was killed by a robot shockingly. I wanted to know about the reason and l was surprised at A in the title was Alex Rosenthal who was creating puzzles. I cannot help but read it.

In the story, A girl named Ethic and her companion robot named Hedge attempt to save the world. They, of course, have to solve programming puzzles to collect THREE artifacts. I now realize that l can’t understand the key programming concept that is a loop. Can l continue to read this? Just it’s a little mistake, it might kill Ethic in Ep9. I wonder so...

Ethic has to say exactly what Hedge does, and this is the challenge of Ep1.

Inside the keyhole is a red dial that can be rotated to one of 100 positions numbered 1 through 100. When the dial goes to the right position, it turns green and unlocks the door. 

The command that won't work well : Try1 and check the light. If it turns green, open the door, and if not, try2. If that doesn’t work try 3. All the way up to 100.

Hints : A loop of the key programming concept, it can be one or more instructions and it should be simple and precise to iterate, repeat, and do a specified number of times.

For loop is to specify the number of times it repeats.

Until the loop is to do an action until a condition is met.

While loop is to turn an action while it’s continuing.

Correct command : To try every combination in succession. Try 1 and check the light. If it turns green, open the door, and if not, try 2. If that doesn’t work try 3. All the way up to 100.


The Resistance | Think Like A Coder, Ep 2

Summary

The challenge of Ep2 is to find the leader of an underground resistance movement who knows the location of the first of three powerful artifacts. Hedge and Ethic don’t know the name. The leader has green eyes. If the leader has red hair, their name has at least one consecutive double letters. If the leader wears glasses, their name has exactly 2 vowels. Otherwise, their name has exactly 3 vowels. There is exactly one person for whom there are all true. ??? I can’t understand programmings and Vowels. OMG.

Hints : This time, we can use a conditional. If A, then B, or if A is true, perform instruction B. Otherwise, carry out instruction C.

Correct command : The point is to mark a check, it can move on to the next question. If mark an X, the person is not a leader and blanks are ok.

Mark a person who has green eyes. marking an X is not a leader.

Next, mark the person who has red hair and whose name has at least one consecutive double letters. Marking an X is not a leader.

Mark the person who doesn’t have red hair and wear glasses and whose name has exactly 2 vowels. marking an X is not a leader.

Mark the person who doesn’t have red hair, doesn’t wear glasses and whose name has exactly 3 vowels!

The leader named Adila could be found. She tells Ethic and Hedge that it needs to reprogram the furnace bots to revolute and to steal the first artifact: the Node of Power.


The Furnace Bots | Think Like A Coder, Ep 3

Summary

I watched Ep 3. In the last, Adila was clenching her fists, though, l couldn’t explain how Hedge reprogramed but l couldn’t write the challenge as well.

Hints : We can use a piece of information called a variable. It’s basically containers that hold onto numbers, words, or other values.

Correct command : With a loop, Hedge can pick any bot at random, look inside its furnace, and store that serial number as a variable. It’s repeating until the stored variable equals 0.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.