Lesson 36

Lessons 32, 33, and 34 were list comprehension and conditionals like if/elif/else, for, and while, all of which I feel fairly comfortable with. Exercise 35 was an application of these ideas in the form of, woohoo, a text-based adventure game! This one came in a bit longer at 76 lines, which I honestly love copying in. He had a few handy tricks that he hadn’t talked about, like the exit(0) which kicks you out of the program, and a few clever nestings and conditionals, like the combination of the boolean in one of the “rooms” with a while and an if/else.

Rather than give each of those its own post, since I don’t have much to add having learned those functionalities long ago, I moved over them so I could advance a bit more quickly. In exercise 36, he asks for a unique game! So I made one! Woo-hoo! After a not too long trial and error period, I came up with the following game, of which the following is probably the most representative output that I got when I had someone else play it. Check the repo if you’re interested in the code! the output is more fun anyway : )

WELCOME TO THE DUNDJEL
you can go north and south. maybe other directions?
> north
You carry on your dumb way north, dummy
You went north! That's probably fine.
You see an A and a B, and also a button.
> a
yeah, you only have so many options, here.
nice that you think I'm smart enough to come
up with more stuff, but I haven't.
> b
yeah, you only have so many options, here.
nice that you think I'm smart enough to come
up with more stuff, but I haven't.
> A
consider all of your options my friend.
but not today, for today you die.
you lose. you see a howling hag:
SHE'S A WIIIIIITCH
BOOOOO. BOOOOOOOO!!

It makes me laugh which is really all that I’m looking for in my own text-based adventures. There IS a way to win, but it doesn’t look like they made it!

Hey, quick sidenote, have you seen Depression Quest? It’s eligible for Steam Greenlight, and it, well, my description won’t do it justice, the concept is amazing & you should just go take a look.

Advertisement

Leave a Reply

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

WordPress.com Logo

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

Facebook photo

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

Connecting to %s