A while back I reported on Leo’s first Hopscotch program, and I’ve variously discussed Hopscotch in other posts, esp. regarding Su Su and my METALS (STEAM + Logic) project. Well, it’s time that I reported on some of Leo and my Hopscotch work since I reported on his first Hopscotch program.
A long time ago — way before having children — I told myself that I would only let my children play computer games that they wrote themselves. Well, okay, that was a bit of a stretch and I haven’t exactly kept to it, but I’m starting to make it work.
I wrote most of that one, but soon enough, Leo was writing his own programs, with a little help around the edges.
When he became obsessed with Portal, we … more like he … wrote a version of portal that used the concept of black holes, white holes, and wormholes:
Leo wrote almost all of the major logic in this one, although I had to do a lot of detailing.
This past week Leo apparently came across a game someplace, maybe at his after-school program, called Plants versus Zombies. I’ve actually never seen it, but Leo wanted to write a zombies program in Hopscotch, so here we have Monkeys versus Zombies, almost entirely by Leo:
Again, Leo wrote most of the major logic and I did some detailing. In this case I had to write one part of the major logic, because it’s actually much more complex than the previous games. In this case you have to buy the characters! (Note the money at the top, and the price of each of the types of monkeys.) So, although Leo wrote the game play for the most part, I wrote the code that tracked the money….although, actually Leo did most of the coding, even of that aspect, although under my careful direction, and I know that he only barely understands that part. For example to keep you from buying monkeys that you can’t afford, you have to test to see whether the amount of money you have left is $-1, because Hopscotch doesn’t have <= or >= tests, only = > and <, here’s the relevant logic:
There was much consternation and confusion over the 24 instead of 25. Note also that this uses control flags. Truth be told, this is a rather complex game, and I was pretty amazed that Leo was able to handle the major logic at all.