Scheme Programming for Six-Year-Olds

Background

My six-year-old daughter is the student. All this happened on a single evening after dinner. I have previously exposed her to Logo. She found it difficult, since it required understanding of angles. Furthermore, it is fairly non-intuitive to stare at a little triangle trying to work out where is front and what is left or right. Turtle graphics requires a sense of orientation, and I don’t think she managed it at all. Better would be a simpler class of Turtle graphics where turtle could be told to move Left, Right, Up, Down in a grid (i.e. 1 unit = 20 pixels). It would have been easier to advance to other concepts quicker.

Getting Scheme

I used Guile, running under Cygwin.

First Exercise (addition)

>(+ 1 1)
2
>(+ 1 1 1)
3

Comments:

Second Exercise (precedence)

Thankfully, my six-year-old has no concept of operator precedence. So Scheme is a good fit, since it requires everything to be explicit.

>(+ 1 (+ 2 3) )
6

I explained that we can ask the computer many questions at the same time. The computer will try to answer one question, and remember the answer in it’s head. Next it’ll try to answer the other question using the answers it remembered. She didn’t seem to get the concept, so I’m going to have to work it out on paper for her.

Actually, the kids have a set of toys much like Russian dolls. Perhaps I can use that as an aid.

Question: Is there any scheme mode that will print the reductions before it arrives at the final answer? i.e.

>(+ 1 (+ 2 3) )
>(+ 1  ( 5 ) )
6

Update: DrScheme does this. Just type the source into the define window, and then hit Step. However, it’s probably still a bit confusing for a little girl.

Third exercise (functions)

I introduced alternatives to “+”, introducing a function “age” which computes her age, given her brother’s age. She seemed to have lots of fun with it.

(age 50)
52

“I’m going to be 52 when brother turns 50!”, she exclaims.

Comments so far

The round braces are a definite problem. It is too easy to have to few or too many. Perhaps a structured text editor which provides the round braces by default might solve that problem. She also had a few problems with spaces, like typing (+5 5) instead of (+ 5 5).
A beginner’s scheme should be more forgiving here.


About

Categories