In a text adventure game (python), I get user input for the next action and use regex to parse the input into two variables. The two variables are the verb and noun of the command, still in string form. For example, user input leads to...
final_noun = 'blow' final_verb = 'bubbles'
The regex is working correctly.
In another file, called actions, I have a list of functions for verbs/actions, including the blow function. I want to call this function up by purely using the final_noun and final_verb from regex. Also, I have the actual final verb object bubbles in the file GameFiles.
i tried: actions.final_verb(Gamefiles.final_noun)
which doesnt work because the inputs are still a string. i then tried using eval in many different ways, such as: actions.eval(final_verb(GameFiles.eval(remaining_noun)))
(This also didn't work)
Thank you for your time
final_noun = 'blow' final_verb = 'bubbles'Aren't those reversed?