My son and his cousins have occasionally expressed an interest in programming (they are 2*13 + 15). But what they mean is, they want to make a game like, say, Halo. And when I explain that GUIs take a bit of doing, not to mention AI, they go back to reading Harry Potter or whatever.
I did play with Scratch. Check it out, it's fun. But I think it gets awkward after a while.
I thought, so OK, let's do a game with the command-line for IO. And I adapted my tic-tac-toe program to this goal. It is short and simple. Rather than read the code, however, I urge you to make your own version.
Here is the printout:
Since I grafted the new IO on top of the game logic, I think that it would benefit from a redesign but I haven't done that yet. Here is the code (128 lines, with blanks). For the future: make the logic cleaner. Also, recognize when a game must be drawn, and bail.