This is a simple program that prints a multiplication table of the first N prime numbers.
- PHP 8.3
- Composer 2.0
- PHPUnit 10
- Node 16.13
- NPM 8.1
- Jest 29.7
- Puppeteer 21.6
- TailwindCSS 3.3
- Clone the repository/
- Run
composer install
. - Run composer
dump-autoload
. - Run
npm install
.
- Navigate to the project folder.
- Run
php -S localhost:8888
. - Open
http://localhost:8888
in your browser. - Enter a number in the input field and click the button or press enter.
- The table will be displayed below the input field.
- Navigate to the project root and run
vendor/bin/phpunit
to run the PHP tests [Unit & Integration tests]. - Navigate to the project root and run
npm run test
to run the JS tests [End-to-end tests].
The current implementaton is a bit memory intensive and slow for large numbers. It can be further improved by using a more efficient algorithm like segmented sieve of Eratosthenes. And for very large calculations it can be further improved by computing in chunks.