Jun 222012

I had heard this afternoon, that the kid was developing a Pokemon game in Scratch while I was at work.  I was interested in seeing how he was coming along on his own.  The message passed along, was that he was done, except for help with the health counters.

I was pretty impressed when I got home.  Of course, I’m biased.

He already had motion down.  The different characters were each listening to a different set of keys for motion.  They were passing messages even (though nothing was listening to those particular messages, the framework was there).  He had a set of health counters and different backgrounds for final game states.  He had the characters and two costumes for them.  But he needed help with the actual battle.

In our ninja game, the objects knew when they touched each other, so he figured that was going to be the same here.  I had him describe it to me completely, since this was core to our game.  I liked that he said he was going to use a strategy that he picked up on while inspecting the logic in a pac-man example program.  When pac-man hit a colored wall, he would stop – so that was another example of object collision.

“When bulbasaur goes over and touches abrock, then abrock is hit!  Wait. No! How can we tell who is hitting who?”

We had a good laugh at that.

After a bit of conversation, it was decided we needed another costume, to define attacking mode.  Which, actually, fit in nicely to the Pokemon character themes.  New keys controls were added.  VineWhip and Poison Dart attacks of course!

We worked on all the logic for VineWhip and once we were able to consistently destroy Abrock, we went about giving him a poison dart attack himself.  Many more messages, new states inspected, and some tweaking to avoid “infinite” attacks and what happens when the two guys attack each other all happened as we made our way towards the final product.

As bedtime was approaching, he wanted a new character added.  We’ll see what happens tomorrow.  I’m looking forward to it.

Update: Catherine just came back after putting him to bed.  She says he’s got two more features he needs to add.  And they both take a day each.  I’m impressed with his ability to estimate and add buffer into his estimates too.  Under promise and over deliver!  (Or, we might just have a lot of Scratch in our immediate future…)

Feb 262012

We did some more programming over the weekend.

I was wondering yesterday, as we were going through it, how much of it he is getting and if I am letting him grasp enough of it, or if I am rushing him through it due to my impatience.

Today, I got a bit of a hint towards that, because we needed to add buttons.  Which don’t really exist in the Scratch world, except as their “sprites” and so every button is an “actor” in a sense.  So we started making buttons as sprites and I was explaining to him how they need to have two costumes, a “selected” costume and a “notSelected” costume.  And we colored the two states of the buttons differently so one could tell when they were in each state.

“It’s like you have this all planned out, Dad” he commented as he went through the repetitive process of putting the same set of actions on each of the buttons.

And I laughed and said that I’ve been programming for most of my life, so I am able to see problems earlier.  But I’m conflicted between making the process seem like a natural conversation and having dedicated design sessions with him.  I think that this stage, we want things to flow and have quick, fast iterations and not be weighed down by “lectures”.  Though at the same time, I want to avoid spoon feeding him solutions and make sure that he’s able to learn how to see problems and break them down.  Though I don’t know how to do that explicitly, so we’re going with a leap of faith on implicit learning for now.

Since this hit my soft spot, I changed the subject and told him that our implementation already had a bug in it that I could see.  I asked if he could see it and he couldn’t.  If he could have, I probably would have annoyed everyone with how many times I’d tell the story bragging about his ability to see that changing the state of one button necessitated the states of the other buttons to be updated.

Though he had fun discovering the bug by running the game.

And we had a lot of fun (I think) writing this last game.  And the part he thought would be the hardest, actually took less than 2 minutes.  Programming the “hard” mode of our game turned out to be pretty easy.  I think that aspect of the program tickled his soft spot for word play.

Anyway, to be safe, I think we’ll design our next game (tic-tac-toe?) on paper first.  To go through some of the design process.  I think he’s taking for granted how easy it is to design an application with me as a tour guide.  As we played some other rock-paper-scissors games on Scratch, we felt ours matched up rather nicely.

Though we’re completely biased.  And Sal’s willing to give you a bajillion dollars if you can beat our game in Hard mode.  Good luck.

As a final point, he did understand the abstraction between our internal representation of a rock (1), paper (2), and scissors (3).  We took a walk after we hit a big conceptual design flaw in our program (in “easy” mode, our first mode we wrote, we programmed the computer to always play paper – our result screens were based on that.  So when we wrote “medium” mode, where the computer plays randomly, the results screens weren’t handling the computer’s new freedom of choice.  That change demanded a dog walk) and on the walk, among other things he was talking about, he mentioned the desire to make a elemental based version of the game.  And we found it on Scratch.  Where fire, water and ice battle each other instead of rock, scissors and paper.

So we talked about what we would need to change in our program and it was really only the “costumes” of our sprites.  Internally, our program could still call things rock (really the value 1) and just draw it as fire – and the game would be the same.  We could even just have it as a choice for the user – if they would like to play Rock Paper Scissors, or Fire, Ice and Water.  I was pretty pleased that the idea clicked so fast.

But to test it, when we design tic-tac-toe on paper, we’ll try and use math only to sum up the rows/columns/diagonals to check for a winning condition.  Or maybe we’ll come up with a better way.  You know, cause it’s not like I’ve got it all planned out already…sheesh.


Feb 222012

I knew I had written about the song The Dollar before – I just didn’t realize it was so long ago.

We had our Dollar moment a few weeks ago.

I have taught some LEGO robotics courses for the DMA a few times.  I’ve enjoyed it each time, but always left feeling a little guilty.  Parents could have saved 2k by just buying the kit and doing a little web searching and playing with their own kids, instead of having me do it.  But time and interest isn’t always there.

It hit a little closer to home last year, as I was dropping Sal off for his own 6 year old robot course summer school.  They had some interesting kits, but were a bit pricey on eBay due to being discontinued.  The replacement Mindstorms kits for kids wasn’t interesting to Sal though.

Especially after he went to the last day of the course I was teaching later in the summer.  He really liked tweaking our full on NXT robot to compete with the other kids in the course.  He wasn’t interested in downgrading to the elementary school version of their robotics kits when he had played with the big boys.

Still, when I threw out the option to have me go teach the class this year in San Diego, I thought with LegoLand there, it’d be slam dunk with the little guy.

“I want to do that!” he said.

It was going how I expected, but the phrasing was a little off.  The way he said “that” seemed odd to me. So I probed a little more.

“I want to goto your class!”  Not goto the beach and maybe the Wild Animal park, while I teach the class?  “No, I want to do the class.”  All day?  “All day!” Every day?  “Every day” he said with a huge grin.

Well, that wasn’t going to work.

Bottom line, I got my kid asking to teach him the stuff I’m teaching other kids. How could I focus on the other kids more than my own?

So this summer, I’m not teaching a DMA course, but instead, trying to figure out how to teach a 2nd-grader-to-be how to program.  We’ll use the NXT kit I think, but I really think I’ll get more bang for the buck from the Scratch programming environment.

He’s played around with Scratch with his mom some afternoons.  They had a game where you had to touch the ninja to score some points, then the ninja would jump away, and you’d have to go mouse over him again.  Sal was really proud to tell me about how he had written a bug – since the game didn’t really end.

It’s a little sad, when one’s son’s way of mimicking one is by creating bugs.  Says a lot about what he thinks of the quality of my work, huh?

Anyway, shameful example aside, we have talked abstractly about how we could define the game ending, and he had it in his head that he would want a big “THE END” to appear and when the color of those letters hit the color of the ninja, the game would be over.

We’ve also had long conversations about which came first, the chicken or the egg. He didn’t always see the connection.

But tonight, after his friend couldn’t make it over for some play time, to avoid any drama over the change in plans, we busted open Scratch and fixed up the game.

It was a pretty good first session.  We defined the end of the game would be after X seconds.  They have a very convenient timer that we made a lot of use out of.  We added a game over background.  Then we added another ninja, so you would have to avoid one while tagging the other. This second ninja had us doing a lot of copying each time we wanted to tweak something, so we got to talk about the responsibilities of each character in the game, and the background started to take over a lot more of the “management” of the game.

So he refactored a program already!  And we had to debug some things.  I don’t think he fully got the nuances behind the race condition we had when the game started and the initial state wasn’t set properly, but he did understand how message passing allowed us to have the stage tell each of the ninjas when to start running (which fixed our race condition).  We are definitely hitting upon the notion of a controller.

Now, he’s dreaming of what’s next.  I’m sure I’ll hear about it quite a bit tomorrow.

And I’m scared.  And happy.  And mainly glad that I’m going to be around to see it develop.

Here’s the game, if you want to try it out…and if you see the kid around sometime, I’m sure he’d love to talk to you about the game in more detail…

Mar 132011

Last week, he didn’t recognize Steve Young.

But Steve Wozniak, he did recognize.  In line for the iPad 2.

And it wasn’t from Dancing with the Stars.  Him and his mom had picked up this book at the library a couple of months ago and so the meeting had more context.  It isn’t like I’m showing a lot of Young highlights around the house anyway.

Would have been cool if he signed the library book.  Generically of course.  But it has been returned. Still, he was very friendly and Sal had a good time.

He enjoys the iPad 2 too.  Especially photobooth.  And Talking Carl.

Aug 052009

Remember those books?  I think it was the only time I “lost” a book from the library and couldn’t return it.  The one where you’re a spy.

In an effort to read more to Sal, I picked up some of these little gems from Amazon.  They have a younger kids version of the books and so far I think they’re a hit.  Like the reviews of the books say, there are some strange endings to some of the paths (like spending a good portion of your life in jail, or getting stuck on a robot planet without ever seeing your parents again), but that hasn’t been too much of an issue. (Update – while making those amazon links, I stumbled upon this choose your own adventure…which seems like it strays a little from their typical recipe.  Browse through the first few pages and tell me if this is the choose your own adventure genre you grew up with – there isn’t a decision point in the first couple of pages, but that first page definitely stands out…I might be getting myself a choose your own adventure book too now.)

What is strange is that Sal will choose the “right” thing to do. He hears a little magical “help!” coming from his sand castle late at night and you ask him if he’s going to go investigate the castle right away or if he’ll wait till morning and he’ll think about it and then wait until morning.  And if he’s got the choice of going to do something himself right away or to go get help or his parents, he’ll go find help or his parents.

So I’m pleased that he does the “right” thing – cause I’m superimposing that onto how he’d react to that situation in real life.  Considering how long he thinks about some of his choices, I think he does take it seriously.

But I’m a little sad that he’s not more “adventurous”.  We haven’t been able to find the sea monster in some lake, cause we keep going the safe route. Though, I don’t want to push him that way and then end up having a kid that is out of control in real life.  I like knowing he’s not going to run out of the house in the middle of the night cause he thinks he hears something.

So we’ve had to swap roles.  Sometimes I get to choose the adventure and my character is the one that ends up being the reckless one and he hears about the adventures that I go on (I’m the one that went to jail, not him.  He found some emeralds that were stolen years ago and returned them to the police…)  Though sometimes I end up with happy endings too.  Ahem.

So overall, I think it’s been a success.  He leafs through the books while I’m at work and he knows that there are pages/pictures of the story that he wants to get to, but we don’t always figure out the path.  When he learns how to reverse engineer the story, I’ll be impressed.

I think this week, while his mom is away, we’ll work on writing our own choose your own adventure book for her to read…

Jul 012009

Parent cliche, I know.  Nauseating to listen to if you don’t have kids.  Old story if you do.

Still, I’m shocked by his progress in around 20 months.