File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -20,19 +20,19 @@ def randomInt(): # range [0 to 2^48]
2020def randomFloat (): # range [0 to 1]
2121 return (randomInt () / modulus )
2222
23- def randomIntRange (min , max ): # custom range
23+ def randomIntRange (min , max ): # custom range [minimum, maximum]
2424 return (math .floor (randomFloatRange (min , max )))
2525
26- def randomFloatRange (min , max ): # custom range
26+ def randomFloatRange (min , max ): # custom range [minimum, maximum]
2727 return (min + randomFloat () * (max - min ))
2828
29- def randomBool (chance ): # chance of getting true
29+ def randomBool (chance ): # chance of getting true (example: randomBool(20) has a 20% chance of returning true)
3030 if (chance == 0 ):
3131 chance = 0.5
3232 return (randomFloat () < chance )
3333
3434
35- # execute functions
35+ # execute functions and print results
3636print ("Sequence of Random Integers between 0 and the Modulus" )
3737print (randomInt ())
3838print (randomInt ())
You can’t perform that action at this time.
0 commit comments