Skip to content

Commit

Permalink
added prime number calculator
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeKittens committed May 21, 2014
1 parent b70639f commit 29921e1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/*
node_modules/*
coverage/*
15 changes: 15 additions & 0 deletions bin/prime
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env node

'use strict';

var num = process.argv[2]
, prime = true;

for (var i = 2; i < num; i++) {
if (num % i === 0) {
prime = false;
break;
}
}

console.log(prime);
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"name": "interview",
"version": "0.0.8",
"version": "0.0.9",
"description": "A collection of command line tools for snarky answers to generic interview questions",
"main": "bin/fizzbuzz",
"bin": {
"fizz": "bin/fizzbuzz",
"fizzbuzz": "bin/fizzbuzz",
"strrev": "bin/strrev"
"strrev": "bin/strrev",
"prime": "bin/prime"
},
"preferGlobal": true,
"scripts": {
Expand Down

0 comments on commit 29921e1

Please sign in to comment.