Not sure if these sorts of changes are welcomed, I was just having some fun toying with some examples and wondered if I could make the balls example run faster.
[x] Reduce array reads through use of temporary variables (the biggest gain!)
[x] Reduce math operations by storing addresses rather than coordinates and then calculating addresses each time
[x] Minimize array allocation to the number of balls entered by user
Not sure if these sorts of changes are welcomed, I was just having some fun toying with some examples and wondered if I could make the balls example run faster.