I woke up pretty early today. Not particularly sure why, but I just couldn't go back to sleep. So, I decided to get up, run the heater, put on a bad movie (in this case it's "Four Christmases"), and code that Word Jumble program. Here it is:
The book does a good job explaining all the bits and pieces of the code, but I'm not 100% sure if I would be able to write this myself. I think what I'll need to do next is do the challenge sections so that I can code without a cheat sheet!
Here's the first challenge this chapter. I needed to write a program that asked for a start number, end number, and a number to count by from the user and print it out.
Second challenge is to get a word from the user and spell it backwards:
What I found challenging regarding this was how to use range and splicing. I couldn't figure out which way to count and which to do and was getting frustrated in seeing my first attempt having the index being out of range. So what do I do? I decided, let's print out what the 'i' is and see what's going in. After that it was smooooooth sailing. Huzzah!
It's funny, through this experience so far, I got easily frustrated, but thought of a different way to figure out the issue and I would get it right. It's the whole programming and debugging process that's actually making this enjoyable. I guess that's why I liked correcting other people's code. Being able to debug and fix and figure out the issues folks were having and being able to help them out. Well there was the additional helping people aspect that made me feel accomplished? No that's not the word. It's rewarding.
Well that's it for this morning so far. I might do more and another post will come its way.
Hello world and good morning.
No comments:
Post a Comment