Day 6.1 Exercise 35 Branches and Functions

Here’s my work.
Here’s the link to exercise 35.

Ex35 Code 1
Ex35 Code 1
Ex35 Code 2
Ex35 Code 2
Ex35 Code 3
Ex35 Code 3
Ex35 Output
Ex35 Output


Study Drill

1. Draw a map of the game and how you flow through it.

2. Fix all your mistakes, including spelling mistakes.
Surprisingly none 🙂

3. Write comments for the functions you do not understand.

4. Add more to the game. What can you do to both simplify and expand it.
I’ve rewritten the cthulhu room prompts to use .include? However I didn’t fix the open door section, just to keep notes to myself.

5. The gold_room has a weird way of getting you to type a number. What are all the bugs in this way of doing it? Can you make it better than what I’ve written? Look at how =~ works for clues.
The =~ is quite confusing, there’s too many ways to use it that doesn’t really fit my requirement. I have made comments on my code. Did 2 ways of working around the bug, one of it however does not take negative numbers.


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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s