March 31, 2010
Tutorial: Guess My Number
Any other ideas? What other "good first programs" are there?
I feel like I'm looking for some intersection between "what is understandable" to a sixth grader and "what is cool" to the same set.
Posted by David at March 31, 2010 09:58 PM
How about string manipulation? Encrypting strings using a cipher. Other simple encryptions.
How about playing the other side of the same game (the guesser?) log2(100) is 6.6, so give it 6 guesses so it will sometimes win. It will even have some actual computer science concepts hiding in it, but you don't have to tell.
For a next step, do you remember the game "mastermind"? I thought that was excellent for pogramming projects - just the right level of difficulty to be accessible without being trivial. In JS, there should be some opportunity to polish up the UI as well. Once again, one can program both sides of it.
Ok, I did this:
It's ~80 lines.
Your post brings back memories - when I was a college student my husband (boyfriend then) and I taught Basic classes to kids - and Guess-the-number was the first proper program we made them write too!
I think the next exercise we had them do was a report card that allowed input of a few subjects and then calculated the average.