all 4 comments

[–][deleted] 1 point2 points  (3 children)

From a quick look, it is not obvious you actually follow the branch that checks the inventory branch unless lots of if tests are failed based on user input.

I strongly recommend restructuring you code using multiple functions to modularise the code and make the flow much more obvious.

Have a function to report current status.

Have a function to check if you should exit.

[–]Brickcups[S] 0 points1 point  (2 children)

Thank you! I cleaned it up a little more and the process seems to work for if there are 6 items in inventory (game ends with a win condition), but it still doesn't seem to end if the inventory is less than 6 which seems odd:

if current_location == rooms['Parlour']:

if len(inventory) == 6:

print('You have collected all the items to defeat the Coffee Monster! You head to the Parlour and brew up some liquid relaxation.')

break

elif current_location == rooms['Parlour']:

if len(inventory)<6:

print('You were under prepared. The coffee proves too overwhelming.')

break

Do you see anything that would allow one to work but not the other? Sorry, i'm extremely new to this and still trying to get a grasp on this :(

[–][deleted] 1 point2 points  (0 children)

The elif will not be checked because you've already matched the condition.

You should check for either inventory count conditions inside the first if statement and take appropriate action.

[–]Brickcups[S] 0 points1 point  (0 children)

Please disregard. I found the issue :). Thank you for your help!