User Tools

Site Tools


journal:spring2019:dgreen16:week4

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
journal:spring2019:dgreen16:week4 [2019/02/12 21:37]
dgreen16 [MONTH Day, YEAR]
journal:spring2019:dgreen16:week4 [2019/02/12 21:41] (current)
dgreen16 [February 12, 2019]
Line 3: Line 3:
 ====February 12, 2019==== ====February 12, 2019====
  
 +The week has been slow, but progress has been made on the notes. The most interesting thing I messed with was a pseudorandom number generator in assembly. It was actually a lot simpler than I expected. Although I've seen an entire 20-minute video describing how they work on other systems (the SNES and Nintendo 64 for example), I never expected to be able to implement it in less than 20 lines of assembly. One thing I was quick to note was that it cycles through the same numbers repeatedly when it's called enough times. It generated a single byte in my case, but it can easily be manipulated to produce a wide range of results. For example, if I needed 16 different results (in my case, it determines the direction a character begins to move), I'd check if each of the 4 bytes was set, and if so, the character would try to move towards the direction assigned to it. Employing strategies like that could, in theory, generate any range of results if it's between 2 and 255. Not only that, but the method could be extended to be multiple bytes long, or the same function could be called more than once to get more pseudorandom bytes. As to how the method worked, it took me ages to figure it out entirely, but it makes me think about all the different things one could exploit in the hardware to get tasks done quickly and efficiently without worrying too strongly about variables or additional hardware that would effectively generate true random numbers.
journal/spring2019/dgreen16/week4.txt · Last modified: 2019/02/12 21:41 by dgreen16