The First Bug

27 10 2009

I don’t remember the first bug I ever made but as everybody knows [citationĀ needed] half the fun of parenting is living vicariously through our children.

The other day my first born (age 5Ā¾) decided to make a board game.

He had already made the dice (that’s another story), so he got out his crayons and went to work.

Buggy board game

Buggy board game

The rules were pretty simple

  • Boat: move one step forward
  • Guard tower: lose two turns
  • Torch: move back one step less than the last die throw
  • Cannon (that’s the one with lots of red circles): go back to the beginning
  • Etc.

We were playing merrily along when the configuration in the picture came up, two steps away from the boat, roll the die and…

  1. The die lands on 2
  2. Move two steps to boat
  3. Boat moves us a step forward
  4. Land on torch
  5. Torch moves us back one step less than was rolled
  6. Two was rolled so go back one step
  7. Land on boat (goto 2)

Whoops, we’re in an infinite loop! FB was quick to realize what was going on and quickly stopped his old man from executing the infinite loop (ruining all my fun), we arbitrarily chose which of the two locations to stay on an kept on playing.

What really made my day about this was that this was a non-trivial bug, any non-programmer (which includes most 5 year-olds) would not think to look for an infinite loop and even I who suspected such a thing might occur didn’t really see it before it happened (in my defense I wasn’t looking very hard), most flows didn’t expose this “bug” and it’s only by chance that we ran into it on the first time we played the game.

So anyway that’s my son’s first bug, what was yours?




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: