User Tools

Site Tools


notes:discrete:fall2021:projects:saf0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
notes:discrete:fall2021:projects:saf0 [2021/10/06 23:44] – Added more usage for random values with project smalik3notes:discrete:fall2021:projects:saf0 [2021/10/06 23:47] (current) – Fixed minor typo smalik3
Line 35: Line 35:
 Surprisingly, one can create a randomized list of numbers in a specific range by not generating random numbers - but generating steadily iterated numbers and storing them in random array indices. This method theoretically saves time on checking to see whether a specific number has already been generated. Traditionally, one would have to increment through the entire array every time a random number is generated. With this method, one only has to check that the random array index is not already storing something or if it is nil. This is because the numbers that are stored increment with each loop - so it is guaranteed to be different. Theoretically, however, this could take just as long as the method where the array index is incremented if there is bad luck with choosing unused array indices. Surprisingly, one can create a randomized list of numbers in a specific range by not generating random numbers - but generating steadily iterated numbers and storing them in random array indices. This method theoretically saves time on checking to see whether a specific number has already been generated. Traditionally, one would have to increment through the entire array every time a random number is generated. With this method, one only has to check that the random array index is not already storing something or if it is nil. This is because the numbers that are stored increment with each loop - so it is guaranteed to be different. Theoretically, however, this could take just as long as the method where the array index is incremented if there is bad luck with choosing unused array indices.
  
-Random values do not just have their usage with random values in an array, but may be used to randomize the selection algorithm used depending on how the game will work.+Random values do not just have their usage with random values in an array, but may be used to randomize the algorithm used depending on how the game will work.
  
 ==A Sort Synopsis== ==A Sort Synopsis==
notes/discrete/fall2021/projects/saf0.1633563858.txt.gz · Last modified: 2021/10/06 23:44 by smalik3