Tonight, after her violin lesson, while eating oatmeal, I reminded her that the violin notes are indeed sequences of actions, where each note is an action. She then asked me whether she could make a "karhu titi" program in that Turtle Roy thing. She meant a program that would play two short notes using the lowest string (G) on the violin. And I was like, yes you can.
So we started by opening our previous work "kielet" in Turtle Roy:
ls
open "kielet"
Now we had a function named "karhu" at use. This function plays the note G. She knew that we need a sequence of two "karhus" to complete our program and she started by defining a new function "karhutiti". It, once again, took quite a while to decide on the final name of the function, but we finally settled with "kt". Actually the long discussion on naming got her to lose her focus... and she didn't remember what to do after
let kt
So I had to remind her of the equals-sign that follows. Then it was time for function implementation. She remembered that the "s" function can be used to make a sequence, so
let kt = s
Surprisingly she didn't remember that square brackets are used in lists. I guess she wasn't in the "zone" anymore. But after reminding her about the square brackets, she hacked the function together pretty quickly:
let kt = s [karhu, karhu]
She tried it and it worked! After another long discussion on naming, we saved the work using
save "sei"
I asked her are we done, and she wanted to do more. Particularly she wanted to add more pictures to her HTML scrapbook, but I refused that as a too heavy a task just before bedtime and suggested some simple drawing with Turtle Roy.
Then she asked me what I'd like her to draw. I suggested a right angle and she started writing a new sequence of things, but we were interrupted by her baby sister who wanted to perform Twinkle Twinkle Little Star in both Finnish and English.
That was indeed pretty cute.
No comments:
Post a Comment