This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:discrete:fall2021:projects:saf0 [2021/09/30 03:53] – more grammatical changes jlangtry | notes:discrete:fall2021:projects:saf0 [2021/10/06 23:47] (current) – Fixed minor typo smalik3 | ||
---|---|---|---|
Line 34: | Line 34: | ||
Surprisingly, | Surprisingly, | ||
+ | |||
+ | 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== | ||
Line 48: | Line 50: | ||
Swapped : [1, | Swapped : [1, | ||
</ | </ | ||
+ | |||
====Display==== | ====Display==== | ||
Line 53: | Line 56: | ||
**Among** the many possibilities for display, the classic example of variably-sized bars tends to come to mind, and, using the scaling techniques that may have been employed in pnf3, this can be accomplished relatively simply by defining the size and position of some rectangles based on the stored value of array positions and their offsets and scaling them to the size of the screen. After that is initially determined, the scaling value may be applied to allow the user to experience the wonders of the TIC80 sorting program (this should be recalculated once per frame with the current state of the array). | **Among** the many possibilities for display, the classic example of variably-sized bars tends to come to mind, and, using the scaling techniques that may have been employed in pnf3, this can be accomplished relatively simply by defining the size and position of some rectangles based on the stored value of array positions and their offsets and scaling them to the size of the screen. After that is initially determined, the scaling value may be applied to allow the user to experience the wonders of the TIC80 sorting program (this should be recalculated once per frame with the current state of the array). | ||
- | Another idea, perhaps more similar to the approaches that many seem to explore in pnf3, would be to arrange the numbers on the screen in some order representing their positions in the array. | + | Another idea, perhaps more similar to the approaches that many seem to explore in pnf3, would be to arrange the numbers on the screen in some order representing their positions in the array. This can simply be done by having a function print the array indices in order after every swap. In this print function - one can also have some if statements that variably determine the spacing in between the numbers, depending on the size of the randomly generated list. This allows fewer numbers to fill the screen more and allows for more numbers to fit on the screen. |
If scaling is not your forte, then numbers can be generated from the lowest pixel position possible to the highest pixel position possible. This is essentially the equivalent of scaling since numbers cannot be represented by pixel positions higher than the bounds of the screen. Both scaling and non-scaling algorithms are fine, and lead to essentially the same thing; one may bring more variation over the other though (scaling). | If scaling is not your forte, then numbers can be generated from the lowest pixel position possible to the highest pixel position possible. This is essentially the equivalent of scaling since numbers cannot be represented by pixel positions higher than the bounds of the screen. Both scaling and non-scaling algorithms are fine, and lead to essentially the same thing; one may bring more variation over the other though (scaling). |