Prime Triangle


Although done on Station 201, I was using the Native ARM Pi-Tube Co-Processor at the time, which made it considerably faster than using the 6502. Having said that, the time taken was still over 12 minutes to draw the triangle large enough to fill all the horizontal pixels in the mode 1 screen.

This is because all the graphics processing is still being done by the I/O processor which takes a long time at 2MHz.

The triangle, then, is made up of individual pixels each representing a consecutive number starting at 1 on the top row. Second row represents numbers 2,3,4 and third row represents numbers 5,6,7,8,9 and so on. Prime numbers are coloured with red pixels, others yellow. We see that the top row is a single yellow pixel, as 1 is not a prime number, then the second row is two red pixels and a yellow pixel, because 2 and 3 a prime numbers but 4 isn't, etc.



Click here to return to Prime Triangle