User Tools

Site Tools


notes:fall2024:projects:pnc0

This is an old revision of the document!


PNCX

algorithm: brute force / trial-by-division

variant: naive

START TIMEKEEPING
NUMBER: FROM 2 THROUGH UPPERBOUND:
    ISPRIME <- YES
    FACTOR: FROM 2 THROUGH NUMBER-1:
        SHOULD FACTOR DIVIDE EVENLY INTO NUMBER:
            ISPRIME <- NO
    PROCEED TO NEXT FACTOR
    SHOULD ISPRIME STILL BE YES:
        INCREMENT OUR PRIME TALLY
PROCEED TO NEXT NUMBER
STOP TIMEKEEPING

variant: break on composite (BOC)

variant: odds-only processing

variant: sqrt point

variant: break+odds

variant: break+sqrt

variant: break+odds+sqrt

timing

One way to calculate your runtime is by using the get_frame_counter() Vircon32 function. You will need to first store the start frames (before you tally the prime numbers) and your end frames (after you tally the prime numbers). Subtracting the start frames from the end frames will give you a value that you can use to find your runtime. The get_frame_counter() function obtains the current value of the frame counter (there are 60 frames per second). If you’d prefer, you could use get_time() or get_cycle_counter(). Just remember the runtime will need to be drawn in seconds with three decimal places for milliseconds.

wedge pnc0 runtimes

VerbalGnat48 pnc0 runtimes

notes/fall2024/projects/pnc0.1727831974.txt.gz · Last modified: 2024/10/02 01:19 by cmazzara