I am sorry, I had a thread similar to this, but I have encountered a different bug.
def rm_b(acts):
print("DINING ROOM")
print(descriptions.dining)
acts={"north":no_exit,
"east":rm_c,
"south":rm_e,
"west":rm_a,
"sandwich":'inv_add(sandwich, acts)'}
prompt(acts)
The "sandwich":'inv_add(sandwich, acts)' will not work. Same for all of the items I wish to allow the player to pick up. My prompt goes like this:
def prompt(acts):
message = input(':').lower()
print()
try:
if message[0:4] != 'take':
acts[message](acts)
elif message[0:4] = 'take':
eval(acts[message[5:]])
except:
no_exit(acts)
print()
The inv_add:
def inv_add(item, acts):
test(" in inv_add")
inventory.append(descriptions.item)
print("You take:"+item)
prompt(acts)
And the descriptions module:
sandwich = ['Sandwich', "A delicious treat."]
I would like to know why it isn't working.
Thank you for reading my post.