-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keeps printing prime number (theoretically) forever.
- Loading branch information
1 parent
b05c6df
commit 9096bc4
Showing
1 changed file
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// Developer- Minhas Kamal (https://minhaskamal.github.io) | ||
// Intro- Keeps printing prime number (theoretically) forever. Number of characters- 61. | ||
// Intro- Keeps printing prime number (theoretically) forever. Number of characters- 60. | ||
// Can be made shorter (53 bytes)- main(m,k){for(;m%k--?:(k=m++);k^1?:printf("%i|",m));} | ||
// Details- https://www.quora.com/What-is-the-shortest-and-most-effective-code-ever-written/answer/Minhas-Kamal?srid=u2HNX | ||
|
||
_=1;main($){for(;_%$?:(_+=$=1);++$*$<=_?:printf("%i|",$=_));} | ||
_=1;main($){for(;_%$?:(_+=$=1);++$*$>_&&printf("%i|",$=_));} |