Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Chevi |
I have an array of strings that are randomly selected,. and I want it to add “():” to it for example:
if it chooses ‘Run’ from the array, I want it to run the Run(): function. How I’m doing it right now is
if state == 'Run':
Run()
if state == 'Attack':
Attack()
But I want a way to not fill my code with a lot of this ‘if’ statements.