Share your repls and programming experiences

← Back to all posts
Efficient Prime Number Generator
TheCoiledViper (87)

An Efficient Prime Number Generator using the Sieve of Eratosthenes concept.
https://repl.it/@TheCoiledViper/Prime-Number-Generator

Comments
hotnewtop
TheCoiledViper (87)

Please feel free to leave any suggestions!

haltosan (5)

I have found it faster and easier to print the numbers one by one, rather than all at once. This was it can handle a huge amount with ease.

TheCoiledViper (87)

@haltosan: Would you be able to send me a link so that I can test the code?

TheCoiledViper (87)

@haltosan: Using the Sieve of Eratosthenes method, my program printed the first 100 prime numbers in approx. 0.0002s

haltosan (5)

@thecoiledviper: just print the number as it is found instead of appending then printing. Btw, I did it in Ruby I think, so not that helpful

TheCoiledViper (87)

@haltosan: okay thanks for the suggestion. :D

TheCoiledViper (87)

@selroh18: Check out the game - https://repl.it/@TheCoiledViper/WW2-War-Plane-Game . I added the upgrade store, and the money you earn carries over to your next game if you win.