From 2a0318b4074aa3e63b880854704351e71bc4bab8 Mon Sep 17 00:00:00 2001 From: JakubDrozd Date: Wed, 3 Nov 2021 09:55:15 +0100 Subject: [PATCH] Fixed a few typos --- .gitignore | 1 - {deleglise-rivat => JSprimesieve}/utilities.js | 0 deleglise-rivat/S0.js | 6 +++--- deleglise-rivat/U.js | 2 +- deleglise-rivat/pi.js | 0 main.js | 8 ++++++-- package-lock.json | 4 ++-- test/test.js | 2 +- 8 files changed, 13 insertions(+), 10 deletions(-) rename {deleglise-rivat => JSprimesieve}/utilities.js (100%) create mode 100644 deleglise-rivat/pi.js diff --git a/.gitignore b/.gitignore index 0e7ba25..4b7390c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -/primesieve-master git-commit.sh /source.zip /node_modules \ No newline at end of file diff --git a/deleglise-rivat/utilities.js b/JSprimesieve/utilities.js similarity index 100% rename from deleglise-rivat/utilities.js rename to JSprimesieve/utilities.js diff --git a/deleglise-rivat/S0.js b/deleglise-rivat/S0.js index 89075e4..c821762 100644 --- a/deleglise-rivat/S0.js +++ b/deleglise-rivat/S0.js @@ -3,10 +3,10 @@ Copyright © 2021 Jakub Drozd For full notice see pi.js */ // Module import -const { mobiustabulator } = require('./utilities.js'); +const { mobiustabulator } = require('../JSprimesieve/utilities.js'); // Function const S0 = (x, y) => { - console.log('Calculating S0') + console.log('Calculating S0'); let mobiustable = mobiustabulator(y); let total = 0; for (let i = 0; i < y; i++) { @@ -14,6 +14,6 @@ const S0 = (x, y) => { } console.log('S0 calculated!'); return total; -} +}; // Module export module.exports = S0; \ No newline at end of file diff --git a/deleglise-rivat/U.js b/deleglise-rivat/U.js index 03268b8..d8fc418 100644 --- a/deleglise-rivat/U.js +++ b/deleglise-rivat/U.js @@ -3,7 +3,7 @@ Copyright © 2021 Jakub Drozd For full notice see pi.js */ // Module import -const { pitabulator, ersieve } = require('./utilities.js'); +const { pitabulator, ersieve } = require('../JSprimesieve/utilities.js'); // Function const U = (x, y) => { console.log('Computing U...'); diff --git a/deleglise-rivat/pi.js b/deleglise-rivat/pi.js new file mode 100644 index 0000000..e69de29 diff --git a/main.js b/main.js index 3e01775..ffaec82 100644 --- a/main.js +++ b/main.js @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/. E-mail: Kuba.drozd09@wp.pl */ // Import of modules -const pi = require('./deleglise-rivat/utilities.js'); +const { pismall } = require('./JSprimesieve/utilities.js'); const { hideBin } = require('yargs/helpers'); const yargs = require('yargs'); const validators = require('./cmdvalidators.js'); @@ -30,6 +30,10 @@ const options = yargs(hideBin(process.argv)) }, argv => { validators.xValidator(argv.x); }) + .option('n', { + alias: 'nth-prime', + description: 'Compute the n-th prime' + }) .help() .alias('help', 'h') .alias('version', 'v') @@ -41,4 +45,4 @@ console.log('JSprimecount Copyright © 2021 Jakub Drozd'); console.log('This program comes with ABSOLUTELY NO WARRANTY; for details see https://github.com/JakubDrozd/JSprimecount/blob/main/LICENSE.txt.'); console.log('This is free software, and you are welcome to redistribute it under certain conditions; see the above link for details.'); -console.log(pi.pismall(options.x)); \ No newline at end of file +console.log(pismall(options.x)); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index d9c22e1..5eaa6a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "jsprimecount", - "version": "1.0.0", + "version": "0.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "jsprimecount", - "version": "1.0.0", + "version": "0.1.0", "license": "GNU GPLv3", "dependencies": { "assert": "^2.0.0", diff --git a/test/test.js b/test/test.js index bf4ae0e..9df4247 100644 --- a/test/test.js +++ b/test/test.js @@ -4,7 +4,7 @@ Copyright © 2021 Jakub Drozd For full notice see pi.js */ const assert = require('assert'); -const utilities = require('../deleglise-rivat/utilities.js'); +const utilities = require('../JSprimesieve/utilities.js'); const S0 = require('../deleglise-rivat/S0.js'); const S1 = require('../deleglise-rivat/S1.js'); const U = require('../deleglise-rivat/U.js');