Some Brazilian Federal University algorithm challenge - I made the Unix Way with PHP
Problem description, if I remember well:
- there is a sushiman who likes a lot prime numbers
- he would like a program to generate all prime numbers with a fixed length
- for example: 4 - it will generate all prime numbers from 1000 to 9999
I made this solution using PHP + Unix Philosophies/Rules
- handle
$argv
withgetopt(...)
- handle input errors like strings or non positive number values
- optimize genprimes.php for algorithm to print faster