Username
Password
Are you new? Sign up now
I’ve forgotten
Home
:.
Downloads
:.
Articles
:.
Projects
:.
Reviews
:.
Forums
:.
Arcade
:.
Klikcast
:.
GOTW
The Daily Click
::.
Forums
::.
Digital Works
::.
Fast Prime Number finder (C++)
Post Reply
Post Oekaki
Posted By
Message
UrbanMonk
BRING BACK MITCH
Registered
07/07/2008
Points
49667
16th February, 2011 at 20:39:39 -
Ok, this is different
I wrote a prime finder in batch:
Copy and paste it into notepad and rename the extension to .bat
@echo off
set test=2
echo. > primes.txt
:loop
if %test%==2 goto :
prime
if %test%==3 goto :
prime
if %test%==5 goto :
prime
if %test%==7 goto :
prime
set /a max=test/2
set i=1
:test
set /a i=i+1
set /a check=test/i
set /a check2=check*i
if %test%==%check2% goto :notprime
if not %i%==%max% goto :test
:
prime
echo %test% >> primes.txt
set /a test=test+1
goto :loop
:notprime
set /a test=test+1
goto :loop
Edited by UrbanMonk
n/a
~Matt Esch~
Stone Goose
Registered
30/12/2006
Points
870
16th February, 2011 at 21:14:45 -
www.mth.pdx.edu/~caughman/Gabe.pdf
An interesting read.
http://create-games.com/project.asp?id=1875
Jenswa
Possibly Insane
Registered
26/08/2002
Points
2723
19th February, 2011 at 13:54:31 -
How about an arm version of this algorithm? O wait that speeds things up on the gba, not windows.
jenswa.neocities.org
Post Reply
1
2
All
Advertisement
Worth A Click