I am working my way through Zed Shaw‘s “Learn Python the Hard Way“, which is both a book with a DVD containing videos of each of the lessons and a web site that does not have the videos. So far, I am really enjoying it. I’m on lesson 36 and I’m only about half-way through the book. One of the things that I really like about it is that he doesn’t try to cram ALL THE THINGS into a single lesson. It is all really bite-sized. In fact, he frequently lists “Search the Web for additional info and features” as part of the Study Drills. As a result, I am getting very familiar with the official Python docs site. Also, the pace is not hurried. There have been several lessons where he says “Work on this for a week”. One of these type lessons was on Boolean Logic. He said make flash cards on, you know, index cards. I used Tiny Cards, which is a new app from the Duolingo people, to create my deck. This seems to work really well.
The reason for this post is not to shill for Zed, but rather to brag about myself, of course. Lesson 36 is to create a Zork-like, text-based adventure game. The lesson is in nested if-else statements and user defined functions. Zed stopped just short of saying “Go hog-wild with it! Throw everything you can think of at this, including the kitchen sink.” Sure, I could have gone deeper, but I am still pretty pleased with what I came up with.
Step 1 in the lesson was to draw out a map and then start to figure out what the different decision points should be. I am going to be honest with you right now: I’m not terribly imaginative. I am sure that plenty of middle-aged dad’s feel the same way. But, what I have as a resource is a five year-old son with a very active imagination, a passion for drawing detailed, full-page scenes, and a love of helping his dad in any way possible. If you could have seen his little face when I asked him to draw up a map to help me out with this lesson! Well, he did a great job.
I asked him about it when I got home from work last night. He already had it out and waiting for me at the dinner table for the walk-through. I made notes on when he told me about the adventure. After he went to bed, I set to work on turning this creation of his imagination into a playable reality. Of course, I knew he was going to be disappointed that it was text-based and not a game with graphics, so I kept that in mind in my writing. It had to be entertaining, and I borrowed some phrasing from his favorite chapter book series, “The Magic Treehouse“. I told him this morning that it was ready for him to play, but he would need his mother’s help. They were soon laughing in the right places and giving pointers on things that could be improved. The biggest critic, of course, was the boy. Apparently, a trap door is supposed to open automatically and I missed that. 🙄 One of the features that I added was a pseudo-randomizer and on every turn there is a 25% chance that you get eaten by the grizzly bear.
result = random.randint(1, 4)
if result == 4:
The bear got you before you could escape!
You are inside a grizzly bear stomach.
It is dark and smelly, but you don't mind...
because you are dead.
The result was a fun game that both of the players enjoyed. It only took a few hours and I figured out a cool way to use a uniformed prompting function to get input from the player.
choice = raw_input("What do you do? ")
choice = prompt()
That is going to come in handy in future Python scripts.
So, props to Zed for this course. It is far more detailed than I figured it would be when I started. It is teaching me far better coding practices than the Cisco DevNet programming course, which is also based on Python. It is going to be a great asset to have these lessons under my belt as the Kyle Byers PyNet course ramps up.
It looks like there are a couple of good ideas in here on integrating WordPress and Twitter.
I am working in the outdoor workshop, aka my backyard, today.
The terrible winter seems to finally be defeated.
Over 70F and I am working in shorts.
Just a couple of days ago, it was snowing.
Anyway, Jenny wants new doors on the upstairs bedrooms.
Not just any door, but fancy louvred doors, so that we get better air movement up there.
It is, after all, a Cape. The bedrooms are, basically, finished rooms in the attic.
We just had a new roof put on, because we discovered that the mold that the previous owners treated for came back with a vengeance.
We’ve all been sleeping in the living room for about the past month.
So, now that the roof and mold are resolved, it is time for doors.
And, because Cape, the doors are not a standard size and I need to cut them down to size.
To do this, I am finally making those guide thingies for the circular saw.
And, in order to actually be able to do this in any kind of efficient way, I need a set of sawhorses.
I left my old set at the old house. They were just cheap 2×4 construction, as are these new ones, but these are way better.
In all, it is a Jay Bates kind of day around here!
My father’s father’s family lived in the area around Watling Street, Dublin, Ireland in the late 19th Century.
One of the longest running addresses that they had was on the now extinct Cooke’s Lane.
I have run across mentions of this laneway on maps from the 18th Century, and every time I find a new-to-me old map of Dublin, I look for Cooke’s Lane.
Interestingly, I have somehow always given the famous Griffith’s Valuation a pass when it came to this family. Truth is, Griffith’s would maybe list my father’s father’s father’s father, but there would be no way for me to know that this man was the father of my great grandfather. He has been a lifelong brick wall for me. I cannot find who his father was. I’ve found the man’s brothers, but not the man himself.
Anyway, I decided to take a look at the Griffith’s Valuation map for this area of Dublin just to see what I could see. I was not disappointed!
This is the most detailed map of the lane that I have seen, and I’ve probably seen most of them.
What is amazing to me is that the building footprints are shown. In one of those houses, my ancestors lived.
As you can see from the map, the area was surrounded by various breweries. In the early 20th Century, the Guinness brewery expanded to such an extent that it swallowed up the smaller breweries and plowed under Cooke’s Lane.
Here is the same section of map, more or less on the edges.
You can still see where Cooke’s Lane used to be.
Griffith’s Valuation is a great resource for Irish genealogy. I particularly love the blended maps feature available at AskAboutIreland.ie. In some places out in the country, you can still see scars on the land from where there used to be houses when the maps were created. Defo worth messing around with for an hour or so.
Anyway, now to look at the actual records associated with Cooke’s Lane and Watling Street. The area had many Hannons living there for a time. Perhaps, I will see the name of my great grandfather’s father, even if I can’t do anything with it.