Ex52- Help with #4(Transition labeled "*") on the map

So I managed to get a simple full version of the game working on the web(localhost). However, even though everything is working, I have a feeling I did not use the ‘*’ transitional label correctly. Can someone give a hint on what the purpose of this is?

I used it as a key reference to one of the rooms, and I am not finding any significant meaning of using it and that’s is why I think there has to be something wrong with the way I used it on my game. Also, how can I share the basic version of my game to get some feedback without posting everything here?

Any help will be highly appreciate it.

I was using the ‘*’ as a catch-all. I would use it as something like if they have one chance to get their choice right, but if they pick anything else the ‘*’ sends them to die.

You can share your code on github.com and then send everyone a link. The process is a bit hardcore but they have good docs. Make a backup of your code before you do this as you can easily erase it. If you do it wrong, then just delete your git repository (repo), and try again.

Ah alright, so see this line:

I think you are thinking of this as “how do I write code to make each room work”. But, you need to think “how can I format my data so I don’t need to write code.”

See how a lot of times you just basically load a room by the name and then run the template? You could eliminate a lot of this code if you put the rooms into a map.

See if you can figure this out from those clues. Can you get rid of the if statements that are picking the right room?

Thank you for the help Zed,

here is the new code:

I built a dictionary on my planisphere file to map the rooms. I had a hard time integrating the while loop for the ‘laser_weapon_armory’ 3 digits code and ‘scape_pod’ room, so I built them outside of the given structure as you can see, is this correct?

Should I keep working on this code?

Thank you again for your help.
Alfredo-

Bingo! That’s what I like to see. You also did that really quick so I say you’ve totally solved this one and should move on.

It took me a a whole day and a half explicitly dedicated to this and had to rebuild several lines of code from scratch many times.

Thank you for the help, with that said I will be moving forward to the following exercises.

One question, should I hide or delete the reference to the solution code here in this thread, or just leave it up here, I am just thinking about the upcoming students to this exercise.

Either way, thank you for helping me with this.

best,
-Alfredo

It’s fine to leave the solution here. It’s fairly particular to your problem and other people might do the same thing.