Edward Can Remember!
Give Edward the ability to remember with the help of variables.
We saw that Edward can communicate with us by printing information of each block in his path. As he moves to a new block and we click the print_info()
button, it prints the state of that block.
Edward with memory
With all the features that he has, is he even aware of what he can do? Once he moves on to a new block, does he remember whether he already potted a plant or removed trash before? He has no way of knowing it! He can’t remember if he has even done any work. If he had a way to store this information somewhere, he would have a purpose. Say, he knows he needs to pot at least one plant and remove trash. But right now he can’t know if he has already done that or not.
So how about we program Edward to remember as well? It would be like giving Edward the ability to memorize.
Look at the widget below, where we see a block called the “Memory Box” that depicts how Edward can ...