This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
notes:discrete:fall2021:projects:pnf3 [2021/09/11 16:59] – created wedge | notes:discrete:fall2021:projects:pnf3 [2021/09/23 06:09] (current) – Added reference for TIC-80 "missing" manual smalik3 | ||
---|---|---|---|
Line 7: | Line 7: | ||
=====Objective===== | =====Objective===== | ||
- | Using the TIC-80 fantasy console simulator on your pi, implement a program that visually displays a graph of the timed results of your various prime algorithms (brute force + optimizations, | ||
- | The graph you should produce can be a simple line graph, perhaps a unique color for each algorithm+optimization, | + | Using the TIC-80 fantasy console simulator on your pi, implement a program that visually displays a graph of the timed results of your various prime algorithms (brute force, brute force + optimizations, |
+ | |||
+ | The graph you should produce can be a simple line graph, perhaps a unique color for each algorithm+optimization, | ||
So: the vertical axis would be time, and the horizontal axis would be the upper bound (getting progressively larger the further you travel to the right). | So: the vertical axis would be time, and the horizontal axis would be the upper bound (getting progressively larger the further you travel to the right). | ||
Line 17: | Line 18: | ||
* ask copious, clarifying questions (so you can better add content) | * ask copious, clarifying questions (so you can better add content) | ||
* craft a coherent and organized document, with information located under pertinent headings | * craft a coherent and organized document, with information located under pertinent headings | ||
- | * explain the fundamentals of the process, conceptual background, algorithmic approach, and you can even suggest particulars related to TIC-80 (certain functions that might prove useful- individual, unrelated snippets to do things like capturing time, or displaying text, etc.) | + | * explain the fundamentals of the process, conceptual background, algorithmic approach, and you can even suggest particulars related to TIC-80 (certain functions that might prove useful- individual, unrelated snippets to do things like capturing time or displaying text, etc.) |
* to get full credit, each individual that submits must perform no fewer than 4 changes to this document (as viewable from the wiki revision system). Failure to do so will result in documentation penalties being applied. | * to get full credit, each individual that submits must perform no fewer than 4 changes to this document (as viewable from the wiki revision system). Failure to do so will result in documentation penalties being applied. | ||
Line 25: | Line 26: | ||
====Display==== | ====Display==== | ||
+ | |||
+ | Since this program is more about comparing times than finding primes, old display methods are out the window; we want to display a graph, not a list of numbers. In doing so, the resulting screen should more or less use its rectangular area to display a Cartesian mapping of upper bound (since the lower bound may always be 2, or some other constant for simplicity) to the time taken for each of the 7 (or 9, including optimization redundancies) calculation methods. | ||
+ | |||
+ | A tried and true method of accomplishing this is the common line, which, by changing its color, may be readily used to represent each of those calculation methods' | ||
+ | |||
+ | Dynamic scaling, as it reads, is variability in size based upon some factor. In our case, that factor is the maximum time taken, as well as the maximum bound calculated. From this information, | ||
+ | |||
+ | < | ||
+ | // Calculate scalers | ||
+ | xScaler = 240 / maximumBound; | ||
+ | yScaler = 136 / maximumTime; | ||
+ | |||
+ | // Now multiply the point coordinates by the scalers. | ||
+ | // This way, if the point coordinates are larger than the resolution, they | ||
+ | // will be shrunk. Likewise, if the graph would only take up a fraction | ||
+ | // of the screen, the points will be scaled up. | ||
+ | point.x = point.x * xScaler; | ||
+ | point.y = point.y * yScaler; | ||
+ | </ | ||
+ | |||
+ | For the displaying of time, since we will be measuring and graphing multiple instances, it may prove useful to store the largest value in a variable and use it to calculate your bound(s) for the time axis. You could also do so statically, which would be more consistent, but has the potential to be less rewarding. | ||
+ | |||
+ | === Upward versus Downward === | ||
+ | |||
+ | While you may be able to scale and display data appropriately, | ||
+ | |||
+ | In order for the bottom left to be treated as the origin (as we expect in a normal graph), the pointers must be subtracted from their respective maximum-possible value from the scaler. | ||
+ | |||
+ | If we were to assume 50 is the maximum possible x-value, then we do " | ||
=====References===== | =====References===== | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
=====Submission===== | =====Submission===== | ||
+ | |||
+ | In order to submit the game file, our " | ||
+ | |||
+ | //Of course, if you are using the TIC-80 application on your Pi then the file will exist there when saved.// | ||
+ | |||
+ | To submit this project using the **submit** tool, run the following command at your lab46 prompt: | ||
+ | |||
+ | <cli> | ||
+ | lab46: | ||
+ | Submitting DESIG project " | ||
+ | -> GAMENAME.tic(OK) | ||
+ | |||
+ | SUCCESSFULLY SUBMITTED | ||
+ | </ | ||
+ | |||
+ | NOTE: " | ||
+ | |||
I'll be looking for the following: | I'll be looking for the following: | ||