commit b668ce7f8a52d08c447a361698f7b440c94dcae2 Author: ilikecats Date: Fri Jul 5 16:49:52 2024 -0700 Testing testing one two 3 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..33d762a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Ignore emacs backups +*~ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b6af122 --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +default: + mkdir bin + c++ main.cpp -o bin/primes diff --git a/README.md b/README.md new file mode 100644 index 0000000..36d3f7c --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# test git repo +## teh code is to generate primes \ No newline at end of file diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..bd697e7 --- /dev/null +++ b/main.cpp @@ -0,0 +1,28 @@ + +// Generate primes using the sieve of eratosthenes +#include +#include + +int main() { + // TODO: make it work with GMP (https://gmplib.org/) + unsigned int nextnumber { 3 }; + bool notprime; + std::vector primes; + primes.push_back(2); // Initial prime + std::cout << "2\n"; + + while (true) { + notprime = false; + for (unsigned int i=0;i