mardi 5 octobre 2021

random.choice() for python using more than 2 positional arguments?

I'm trying to use the random module to iterate through a list of 123 positional arguments, specifically, all the keys my ai will need to press in order to do anything on my game. Without the random list it responds to single keypresses with pyautogui, but extending to the large sum needed to play the game it gets fussy with me. I want my ai to learn from this random list, which keys will bring it the most reward. The issue is when I run my code it either tells me that it can't do more than 2 or sometimes three if I do random.choices() or it just runs down the timer and fails to do anything. I've tried other suggestions from using numpy random to enclosing it in double brackets, to ([]), to random.Random.choice(_inst, etc). Does anyone have better suggestions for my dilemma?

Thank you for taking the time to read my question, I hope it is straight forward enough. I can also provide the specific code for what I'm trying to run upon request, I just didn't want to clutter this question up because it seemed easy enough to say simply.




Aucun commentaire:

Enregistrer un commentaire