Recursion Gone Wrong: The Grat Bread-Slicing Incident

2 months ago
11

[Officer]
Miss Amanda, I'm sorry to say,
But staying silent might save you today.
Every word you speak, keep in thought,
It can be used against you in court.

But remember, I'm your friend in here,
The local officer you should never fear.
Just tell me what led to this event,
So next time we do not end in chaos descent.

[Amanda]
Officer look for every programmer you can find,
For they are — the greatest curse of mankind.
I gave one a chance, tried to be kind,
To help him fix his troubled mind.

But believe me, they just wear human skin,
Their thoughts are alien, far from our kin.
I asked him to boil some water with care,
He rewired the sink — let it boil in there.

[Officer]
Miss Amanda I understand what you say,
And also that you are in dismay,
Tell what led to the moment we discuss,
Court is soon — there’s no time to fuss.

[Amanda]
I really wanted it to work out,
So I learned what programmers are all about.
I read that recursion is what they liked,
And thought about how can it be applied.

In recursion, you repeat the same, you see,
Till the base case comes, setting you free.
Everything’s tied together at last,
The product appears, and the troubles are past.

[Officer]
Miss amanda I'm sorry to admit,
That i know about programming less than shit.
I don't understand this recursion and what you say,
Can you explain it any other way?

[Amanda]
The algorithm goes like this,
Take a knife in your hand, ball your other into a fist.
Take a slice from the ingredient to your right,
Then repeat the same on the other side.

To prevent it from running to infinity,
Slicing slices alternating sides should have and end you see,
A base case that stops the cutting part,
Then from the end it goes back to the start.

The base case was the cucumber, you see,
One slice of that brought him back to reality.
He stopped slicing and then began,
Assembling ingredients, as fast as he can.

Starting from the final slice,
Each piece stacked neatly, precise.
Layer by layer, one by one,
Till he finishes up with the bun.

Then a sandwich is complete,
ready for the algorithm to repeat.

[Officer]
Thank you, Miss Amanda, I see your reply,
But what I don’t get is how it went awry.
You just teached how to make a sandwich to that guy,
Just a sandwich for customers to buy.

[Amanda]
The problem is, it only worked fine,
If I placed the ingredients right on time.
But a catastrophe came into play,
Because I left his side that day.

And he worked on, slicing to the right,
Then found nothing to his left side.
Following the algorithm, bit by bit,
He turned right again, found a bread-slice to split.

When I came back, I saw with a frown,
Bread sliced thinner than paper cut down.
I tried to stop him, but I admit,
His mind was lost in a recursive pit.

No matter what I tried,
His slicing still applied.
I’ve never seen eyes so dim,
And never bread sliced so thin.

[Officer]
Thank you Miss Amanda I think I understand,
After this you were gone and went,
To find someone help him out of his trance,
And it was then when physics fell out of balance.

[Amanda]
Yes, you’re right, but tell me this—
Did an atom really split amidst all this?
If so I can't understand by my life,
How he was able to split it with a knife.

[Officer]
Miss Amanda, I get what you’re saying, for sure,
But your troubles are far from pure.
Insufficient knowledge of the law,
Won’t protect you from its claw.

It's clearly stated in paragraph twelve,
"You should not leave a programmer by himself".
And did it you really never think about,
Putting a cucumber to his left, would have stopped him without doubt?

Loading comments...