Wednesday, August 3, 2011

LPTHW Exercise 35 and 36

LPTHW exercise 35 brought home a lot of function and control structure concepts with an example of a small text adventure game.

http://learnpythonthehardway.org/book/ex35.html

Exercise 36 asks that you take what you learned and make one of your own. I'm doing basically a five room "hunt the wumpus" game. The structure is basically every room has its own function, and each room asks which way you want to go or where you want to fire your arrow which then either calls the respective room's function, or the fire arrow function. It's not a "proper" way of organizing data for a game but it's just to drive home functions and control structures.

This really brings me back to middle school doing some QBasic programming along the same lines. I have a really strong grasp of control structures because of all the nested if-loops and while-loops of the text adventure games my friends and I used to make together. It sucks that ASCII graphics is now really hard to do since terminal interactivity is now considered an anachronism (among most folks, anyways).

No comments:

Post a Comment