Great Software Starts with Passion
Last night, I was going to write a little program to test Daniel on his multiplication tables, since his teacher has sent around some kind of signature-line-bearing commitment form, as it were, asking parents to commit to making their children practice multiplication 20 minutes per day. The school refers kids to some website where they can practice, but I thought it might be more fun for Daniel if he had his very own little program which challenges him to type the product of randomly-selected factor, submitting them to the DOS prompt. The program will let him know whether his answer was correct, congratulate or commiserate based on that status, keep a score of right/wrong answers, and then move on to the next one, giving him his total score at the end.
But before I sat down to write it - and I never finished it, thus far, because of this very interesting detour - I thought Ian might like sitting next to me as I write it, so I can explain the logic behind the program, show him how each issue I tackle can be researched on line, and then watch my type each command and test it more or less line by line. I chose Python as the programming language, primarily because it's easy to write, you don't have to compile it (it's merely interpreted at runtime), and it should be especially friendly to this kind of undertaking. But another bonus with Python is that I hardly know it myself, so I figured Ian could watch me learn it as he starts to learn it himself, and hopefully he can pick up on how to teach yourself a language in the process.
I must say, the results were far beyond what I had anticipated.
I showed Ian that first we need to write code to ask the end-user a question and save the answer into a variable, then incorporating that answer into the content of the next line that the program prints out. We started simple. I wrote a program that asks you your name, and then answers, "It's wonderful to meet you, Clive!" (or whatever name you provide).
Then Ian got his own ideas.
Here is the content of the DOS shell where Ian tried out his greatly-enriched version of the same program, which he modified to engage Daniel in particular:
C:\projects\20141105\project_develop_MathProgram_For_Daniel_20141105\take1>IansMathWork.py
What is your name?
HAppyPappy
It's wonderful to meet you, HAppyPappy!
This thing is working? Playtypus! Daniel, don't touch my stuff!yg/v Hey don't touch the keyboard like that!-Past Ian
HAppyPappy, is it? That's a horrible name! How did your parents live with that?
Pipe down, Daniel McFinklebutt! Yes, that's your middle name! No one wants to hear your insults!
Well, do you? says Daniel.
Never
Put in a real answer! Yes or No!
C:\projects\20141105\project_develop_MathProgram_For_Daniel_20141105\take1>IansMathWork.py
What is your name?
Ya Bum
It's wonderful to meet you, Ya Bum!
This thing is working? Playtypus! Daniel, don't touch my stuff!yg/v Hey don't touch the keyboard like that!-Past Ian
Ya Bum, is it? That's a horrible name! How did your parents live with that?
Pipe down, Daniel McFinklebutt! Yes, that's your middle name! No one wants to hear your insults!
Well, do you? says Daniel.
No
Well too bad, you spookly-the-square-pumpkin for brains! Daniel! No, they'll hae to listen!
Well, sorry. You're going to have to sit through a long time of Daniel,Ya Bum!
Of course, Daniel absolutely loved the sassy-talkin' program, even though - or perhaps especially because - it was customized for him as the end-user.
Now here's Ian's multiplication test program, where instead of selecting factors between 1 and 6, he chose, for the first factor, randomly-generated numbers between 1 and and 100 for the first number, and a randomly selected number between 1 and 1 billion for the second number:
C:\projects\20141105\project_develop_MathProgram_For_Daniel_20141105\take1>RandomNumbering.py
15
76816894
What is 15 x 76816894? (If you don't get it, you stink!)Answer here.
61389242357753232222466789
BOOHOO! Well too bad in a British accent! Suck it up and eat toxic waste so you can be useful!
1152253410
It's this, ya bum!
Needless to say, this is how most great accomplishments begin, I've never seen anyone more excited about writing code. Needless to say, ever after I made him go upstairs and get ready for bed, he was still speculating as to how he could "improve" his programs, to make the insults more outrageous.
(November 5, 2014)

0 Comments:
Post a Comment
<< Home