Example code - Classes: Revision history

Jump to navigation Jump to search

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

20 March 2024

6 March 2024

  • curprev 15:0215:02, 6 March 2024WikiSysop talk contribs 3,793 bytes +3,793 Created page with "You know how I often use primes in my examples, so I decided to make a prime number generator class as an example.<br> It is able to generate a range of primes, somewhat similar to the way '''range()''' works.<br> Wanting to be smart, I decided to store the primes I have already computed in a class variable, so I do not have to compute them again at least while the program runs.<br> I am doing a running incremental calculation of primes, storing them as I find them, and..."