Still alive

I made it back from Moab alive.  Three days of incredible riding.  On day two I fell over and got a little bang on my elbow.  On day three it was still hurting.  By the trip home I was in serious pain.  My arm looked like one of Popeye’s arms.  The little bang got an infection and now my elbow is a very unhappy camper.  The Doc gave me some antibiotics but no result yet.  It is amazing what you can and cannot do when the elbow is not working.  I cannot scratch my nose with my left hand.  Next time I am going to wear knee and elbow pads.

Now it is time to get back to the teaching of programming.  The class has been working with a text file of Shakespeare’s Sonnets.  (Trying to throw in some culture here.) They have been doing simple things like counting letters and words in a sonnet.  No biggie, they are cruising through with no major problems.  Being oh so clever I gave them a little extra from the original assignment I stole the idea from.  The sonnets are all numbered in the following format.

end of sonnet


start of next sonnet

The user input is the number of a sonnet.  The output is print the sonnet.  This is not a trivial problem for the kids.  They still have problems differentiating when something is a string and when it is a number.  The input is a string although it looks like a number (Python inputs are strings), the number in the sonnet is a string with an added period. The fun part comes when deciding where the end of the sonnet you want to print is.  Do you look for the next blank line or the next number?  If the next blank line then the code has to ignore the blank line right after the desired number.  Oh yes, and blank lines are really not blank, there is a end-of-line character in there.  If using the next number then the entered string number has to be converted to a number number (got that?), incremented by 1, then converted back to a string number so it can be located in the text file.  Neither method is complicated, it just requires the kids to realize what the have to do and what the issues are with each method.  They have to think and that is just so much work!  Poor kids.  I just love this job.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: