diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2020-09-21 23:13:57 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-21 23:13:57 +0100 |
| commit | 0993bbcf1c985254af38e5e3ff935c2443aaa7d6 (patch) | |
| tree | 863d3570b8d92dae4a2c02dec154f9a27873b2d1 /challenge-079 | |
| parent | 4003228d0dad17e305cf0f40f3e8449d02c3f61f (diff) | |
| parent | 97015ff86483bc3096f0e81ec93e982894e2a70d (diff) | |
| download | perlweeklychallenge-club-0993bbcf1c985254af38e5e3ff935c2443aaa7d6.tar.gz perlweeklychallenge-club-0993bbcf1c985254af38e5e3ff935c2443aaa7d6.tar.bz2 perlweeklychallenge-club-0993bbcf1c985254af38e5e3ff935c2443aaa7d6.zip | |
Merge pull request #2342 from Abigail/abigail/week-079
Abigail/week 079
Diffstat (limited to 'challenge-079')
| -rw-r--r-- | challenge-079/abigail/input-1-1 | 3 | ||||
| -rw-r--r-- | challenge-079/abigail/input-1-2 | 1 | ||||
| -rw-r--r-- | challenge-079/abigail/input-1-3 | 1 | ||||
| -rw-r--r-- | challenge-079/abigail/node/ch-1.js | 5 | ||||
| -rw-r--r-- | challenge-079/abigail/output-1-1.exp | 3 | ||||
| -rw-r--r-- | challenge-079/abigail/output-1-2.exp | 1 | ||||
| -rw-r--r-- | challenge-079/abigail/output-1-3.exp | 1 | ||||
| -rw-r--r-- | challenge-079/abigail/perl/ch-1.pl | 2 |
8 files changed, 11 insertions, 6 deletions
diff --git a/challenge-079/abigail/input-1-1 b/challenge-079/abigail/input-1-1 index b8626c4cff..6163d212e2 100644 --- a/challenge-079/abigail/input-1-1 +++ b/challenge-079/abigail/input-1-1 @@ -1 +1,4 @@ 4 +3 +1000000 +1000000000 diff --git a/challenge-079/abigail/input-1-2 b/challenge-079/abigail/input-1-2 deleted file mode 100644 index 00750edc07..0000000000 --- a/challenge-079/abigail/input-1-2 +++ /dev/null @@ -1 +0,0 @@ -3 diff --git a/challenge-079/abigail/input-1-3 b/challenge-079/abigail/input-1-3 deleted file mode 100644 index 749fce669d..0000000000 --- a/challenge-079/abigail/input-1-3 +++ /dev/null @@ -1 +0,0 @@ -1000000 diff --git a/challenge-079/abigail/node/ch-1.js b/challenge-079/abigail/node/ch-1.js index 6c9ca09ace..7d5f18664a 100644 --- a/challenge-079/abigail/node/ch-1.js +++ b/challenge-079/abigail/node/ch-1.js @@ -19,6 +19,9 @@ // bits (2 * N + 1) = 2 * bits (N) + N + 1 // + +let BIG_NUM = 1000000007; + // // Create an interface to read from STDIN // @@ -30,7 +33,7 @@ const rl = require ('readline') . createInterface ({ // Read lines of input, calculate the result, and print it. // rl . on ('line', (line) => { - console . log (bits (+line)); // Unary + numifies + console . log (bits (+line) % BIG_NUM); // Unary + numifies }); diff --git a/challenge-079/abigail/output-1-1.exp b/challenge-079/abigail/output-1-1.exp index 7ed6ff82de..9720b4da3e 100644 --- a/challenge-079/abigail/output-1-1.exp +++ b/challenge-079/abigail/output-1-1.exp @@ -1 +1,4 @@ 5 +4 +9884999 +846928043 diff --git a/challenge-079/abigail/output-1-2.exp b/challenge-079/abigail/output-1-2.exp deleted file mode 100644 index b8626c4cff..0000000000 --- a/challenge-079/abigail/output-1-2.exp +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/challenge-079/abigail/output-1-3.exp b/challenge-079/abigail/output-1-3.exp deleted file mode 100644 index b489242255..0000000000 --- a/challenge-079/abigail/output-1-3.exp +++ /dev/null @@ -1 +0,0 @@ -9884999 diff --git a/challenge-079/abigail/perl/ch-1.pl b/challenge-079/abigail/perl/ch-1.pl index a2a8d27818..02b473bcf3 100644 --- a/challenge-079/abigail/perl/ch-1.pl +++ b/challenge-079/abigail/perl/ch-1.pl @@ -45,7 +45,7 @@ sub bits ($n) { } } -say bits (<>) % $BIG_NUM; +say bits ($_) % $BIG_NUM for <>; __END__ |
