Created
April 8, 2023 23:14
-
-
Save estevaofon/9a038d5b0e4c5d09585a5279c542fb19 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gen_random(a, c, m): | |
seed = 4 | |
def make_random(): | |
nonlocal seed, a, c, m | |
seed = ((seed * a)+c) % m | |
return seed | |
return make_random | |
my_random = gen_random(5, 8, 7) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment