Print Story Blown away by an 11 year old
Educashun
By stevew (Sat Jul 29, 2006 at 09:53:45 PM EST) (all tags)
Yesterday, I ran a four hour workshop for a branch of our state Gifted & Talented Kids association.


The topic was "Introduction to Computer Programming" and the kids who turned up ranged in age from 8 to 12. None of the kids had cut code before. I used FreeBasic as a language as it is free, has a workable and non-intrusive IDE and has a low barrier to actually producing visible results. (It doesn't use line numbers and is rich enough not to need goto so it is closer to pseudo-code than old school basic.)

After about an hour and a half we were through variables and data types and most of the control flow statements. I did a quick reinforcement exercise after each concept, each of which used most of what we had previously covered.
The exercise we were up to was to print a set of 'lotto' numbers (6 random integers from 1 to 46 with no repeated numbers). Simple enough but you need to use an array for your results and progressively iterate over the array to avoid duplicates.

One of the kids started typing the moment it was clear what I wanted done. I gave them about five minutes to write it and then started walking round the terminals to check what they had done. It takes about another five minutes to do that because if anybody has a problem I can't prompt them through, I call everyone to stand around and help debug that code.

I then get to the second to last guy - they one who started first. He was still furiously typing. Then I see the scroll bar and line count - he is down to about page five.
He stopped typing about a minute after I arrived and said: "Sorry if this doesn't work - I haven't tried to compile yet".

Compile:

Zero errors.

Run:

Up comes a menu for a pay to play lottery system. The first menu has an owner and a customer screen. On the customer screen you get to buy one or more games, where either the computer picks a set or your submit your own numbers and you get told a payout. The management screen tells you the number of games played and the owner's current take in $ and lets you set a percentage return. The payouts are based on the probability of the result and that percentage.

This guy, having been introduced to programming for only 90 minutes, designs and writes a user friendly application with both user and management functionality, robust entry validation, using about five new statements we hadn't even looked at (from the help file), all in about ten minutes and the code compiles first time without error and runs perfectly. The 200+ lines of code was also clean, well structured and readable. The only problem was a few spelling mistakes in the prompts. I would have had trouble even typing 200 lines that fast without an error. He is 11.

My first thought was: "Oh no, maybe I have started an addiction to programming here and deprived the world of somebody who could have solved some real problems".

There were a few other jaw-dropping moments but none as good as that. One guy sat there for two minutes with his eyes closed while they were meant to be coding something to solve a Diophantine by an exhaustive search. He then typed for 10 seconds and said: "done". He had factored down to the three digit primes I had used to make sure there was only one solution. His program just printed that solution.

They have been mailing me since 8am (Sunday) with clever stuff they have done today. If I could give up my day job and work with those kids full time, I would do it in an instant. I can feel a plan for a Summer Camp coming on. Maybe we will write a simple game. Something multi-threaded and real time should stall them for a while.

Oh well, Monday is back to: "We don't care about referential integrity - it slows down data entry. Just write something to fix it up afterwards".

< You are the salt of the earth | BBC White season: 'Rivers of Blood' >
Blown away by an 11 year old | 2 comments (2 topical, 0 hidden) | Trackback
Nice, by Pasofol (4.00 / 2) #1 Sat Jul 29, 2006 at 10:19:55 PM EST
reminds me of another husite back in highschool which will remain nameless.

I'm sure the kid has some experience programming, in at least a different language.  Can't believe everything they tell you, they can be more deceiving than you think.

Makes me wonder why I really didn't get into programming myself when I had a chance, wasn't bad at it just lazy.

vs2fp, good story by cam (4.00 / 1) #2 Sun Jul 30, 2006 at 09:04:43 AM EST
nt

cam
Freedom, liberty, equity and an Australian Republic

Blown away by an 11 year old | 2 comments (2 topical, 0 hidden) | Trackback