Thursday 24 April 2008

Outsmarted by My Six Year Old

I was feeling pretty cool. Then my six-year-old daughter put me back in my place.

I've had free time at work so I've been coding some "timewaster" games in Java. I started with tic-tac-toe. Then I tried something more complex each time...matching game...blackjack...yahtzee. The one I worked on last week was hangman. I was very pleased with it so I brought it home to let the kids try it out.

You can either play from a random word selected from a list, or you can have someone else enter a word (in a password input field so you can't see what they're typing). The kids were taking turns, one typing in the word, the other playing the game. Our six year old was solving the phrase each time without guessing any of the wrong letters. After the third straight time we were curious as to how she was doing so well.

The older daughter typed in a new phrase to start the game. The younger one looked for a second and before even guessing any letters, asked, "Is it 'Dogs and puppies'?" The older one's jaw dropped.

"How did you know?!!"

Then my six year old daughter pointed out something I had overlooked for a whole week while developing the program. When you type in a phrase to start a game and then click the "Start Game" button, it tacks on the phrase to the end of the URL in the address bar, like this...
http://localhost:7001/HangManWeb/initialize.do?phrase=Dogs+and+puppies

The kid is a genius. I even had a system tester at work go over my application and they didn't catch that. She picked up on it in just a couple of minutes. I told my boss the next day and he offered her a job. With a higher salary than me.

1 comment:

Atomic Punk said...

~Scooby Doo Villain Voice~
You would have gotten away with it if it hadn't been for those meddling kids.