mardi 21 juillet 2020

Seeding Random in a Single Def

In my program I'm trying to include a random place generator, and instead of saving each place that's generated (for people to explore) I'd rather just reuse the seed that I used to generate the place to begin with, though this could conflict with other parts of my code. Is there a way that I can seed random within the scope of the def? Or at the very least in the scope of the file? If it's not possible with the stdlib random is it possible with a separate one? I'm using python 3.8 by the way.




Aucun commentaire:

Enregistrer un commentaire