On the last page, we learned that, by using Saya’s lunchbox, we can reproduce the “Plus 1” feature of a mathbox.
That’s it for the quick review. Let’s continue.
Looks like Saya noticed something strange.
Hey guys, can you take a look at this?
First, this lunchbox can be converted to , right?
Yes, but what about it?
What do you think happens if I combined it with my lunchbox that reproduces the “Plus 1” feature ?
Well, because it calculates …
It should become a lunchbox that can be converted to , right?
Let’s run it to check.
Press Run . You can also skip to the end.
Unfortunately: I won’t be able to convert this lunchbox into a mathbox.
Why not? Because it doesn’t follow this pattern.
There needs to be exactly one on the top-right, but there are two in this case.
Hmm… what’s going on? Last time, it worked…
Let me tell you what’s going on.
First, let’s label each item with t, l, m, or r.
Notice that: The sandwiches are labeled as either t or m.
Now, here’s the secret: If the same item exists in both t and m, then the result changes.
In this case, is in both t and m.
That’s why it couldn’t calculate .
Really? Why does that happen?
Let me use a simple example to explain.
Here’s a simple example that illustrates my point:
Let’s see what happens to each lunchbox.
We’re not done yet, but did you notice something?
The bottom two are different on the left, but they’re the same on the right.
Yes. And if we continue until the end…
So this is before and after:
So, this illustrates that: If the same item exists in both t and m, then the result changes.
Let’s go back to the previous example that could NOT calculate .
This failed because was in both t and m, which caused the result to change.
Hmm… then what should we do in this case? Just give up?
Let’s not give up. I think there’s a way.
But… what can we do?
Let’s ask Minion if we can change the rule to fix this.
Minion: I’d like to ask you for a favor. Can we please add a special rule?
Special rule? What do you mean by that?
I’d like the following special rule to apply in cases like this:
Sure, that’s fine.
What… you can change the rule just like that?
Let’s add the following special rule:
So, if there’s the same item in both t and m… (in this case: )
Because of this special rule: The sandwiches in t will now become something else.
What does it become then?
It will turn into a random food item that’s not yet used.
In this case, it becomes fried potatoes .
on the top became .
And t and m no longer overlap now.
Yes. Let’s continue then. Press Run :
Yay! It became a lunchbox that can be converted to .
That means it calculated successfully.
Yes. Let’s summarize what we just did.
What we learned: If you combine Saya’s lunchbox which reproduces the “Plus 1” feature …
…with the following lunchbox which can be converted to …
Then: There will be the same item () in both t and m.
Because of this, if we don’t do anything, it won’t be able to calculate .
However, the special rule applies in this case:
By doing this, it will be able to calculate .
I get it, but I don’t know if I can remember to use this rule…
Don’t worry: This special rule will appear starting from the next page, but you don’t have to memorize it. It will just happen automatically.
You just need to know that these rules exist, and you should be fine.
Anyway: We figured out how to reproduce the “Plus 1” feature .
As you promised, give us our mathboxes back!
Will the villagers get their mathboxes back? Let’s see on the next page.
Before you go: I’d really appreciate it if you could retweet the following tweet before closing this page.
If you’re a programmer:
To keep reading this course: Press the button below!