Skip to content

Commit 6a35c52

Browse files
author
NerdOfCode
committed
Added new file
1 parent b4e4f81 commit 6a35c52

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

JavaScript/prime_finder.html

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
2+
<!--
3+
NOTE:
4+
5+
As JavaScript is pretty inefficient and sucks up system resources
6+
7+
I have set a limit on how many numbers it can test before it stops...
8+
9+
Feel free to change this number but beware, I have warned you...
10+
11+
_ _ _ ___ __ ____ _
12+
| \ | | ___ _ __ __| |/ _ \ / _|/ ___|___ __| | ___
13+
| \| |/ _ \ '__/ _` | | | | |_| | / _ \ / _` |/ _ \
14+
| |\ | __/ | | (_| | |_| | _| |__| (_) | (_| | __/
15+
|_| \_|\___|_| \__,_|\___/|_| \____\___/ \__,_|\___|
16+
17+
18+
How to Use: To use this, all you have to do is look at the console log!!!
19+
20+
To achieve this, on most modern web browsers all you have to do is click
21+
22+
Crtl + Shift + I and navigate over to Console!
23+
-->
24+
25+
<p id="replace"></p>
26+
<script>
27+
var number = 3;
28+
var div = 2;
29+
var count = 0;
30+
var limit = 4545;
31+
32+
while(div < number && count < limit){
33+
if(number % div == 0){
34+
number += 1;
35+
div = 2;
36+
}else if(div < number/2){
37+
div += 1;
38+
}else{
39+
console.log(number);
40+
number += 1;
41+
}
42+
43+
count += 1;
44+
}
45+
46+
</script>
47+

0 commit comments

Comments
 (0)