LogFAQs > #956368438

LurkerFAQs, Active DB, DB1, DB2, DB3, DB4, DB5, DB6, DB7, Database 8 ( 02.18.2021-09-28-2021 ), DB9, DB10, DB11, DB12, Clear
Topic List
Page List: 1
TopicITT: Learning Python
SpiritSephiroth
07/22/21 9:25:52 PM
#102:


SomeLikeItHoth posted...
Spent another 30 minutes and finally figured it out! I forgot to put a @property (look this up) tag above one method and I made three other typos. So it was a combination of things. But now my code is working 100%. Just needed to do some trial and error.

That's great. Now my suggestion to you would be to search how other people did something similar and compare it to yours. Here's one I did a few months ago.


1337toothbrush posted...
Alright, so I threw together a quick and dirty structured text adventure. Each room is its own function and the game runs in a loop with a win or loss condition. This allows you to jump back and forth between rooms and adding a room is simply a matter of writing another function and having one of the existing rooms simply "link" to that room by setting the state.

Here is the link: https://ideone.com/xFIwVn (You can see the execution here with sample input under stdin)

and here's the pastebin if you prefer that: https://pastebin.com/SAmvm6Fr

Thanks! I'll give these a go. I tried to do If statements myself but totally forgot to create variables like an idiot. Such a basic mistake lol

---
... Copied to Clipboard!
Topic List
Page List: 1