aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-077/abigail/Part1/input41
-rw-r--r--challenge-077/abigail/Part1/output4.exp7
-rw-r--r--challenge-077/abigail/Part1/solution.js2
-rw-r--r--challenge-077/abigail/Part1/solution.pl2
4 files changed, 10 insertions, 2 deletions
diff --git a/challenge-077/abigail/Part1/input4 b/challenge-077/abigail/Part1/input4
new file mode 100644
index 0000000000..66a899ac41
--- /dev/null
+++ b/challenge-077/abigail/Part1/input4
@@ -0,0 +1 @@
+377
diff --git a/challenge-077/abigail/Part1/output4.exp b/challenge-077/abigail/Part1/output4.exp
new file mode 100644
index 0000000000..4fc109d510
--- /dev/null
+++ b/challenge-077/abigail/Part1/output4.exp
@@ -0,0 +1,7 @@
+1 + 2 + 5 + 13 + 34 + 89 + 233 = 377
+3 + 5 + 13 + 34 + 89 + 233 = 377
+8 + 13 + 34 + 89 + 233 = 377
+21 + 34 + 89 + 233 = 377
+55 + 89 + 233 = 377
+144 + 233 = 377
+377 = 377
diff --git a/challenge-077/abigail/Part1/solution.js b/challenge-077/abigail/Part1/solution.js
index 6a3d839342..f2d7173403 100644
--- a/challenge-077/abigail/Part1/solution.js
+++ b/challenge-077/abigail/Part1/solution.js
@@ -28,7 +28,7 @@ let N = +fs . readFileSync (0) . toString () . trim ();
// up to the target number. Store this in FIB.
//
let FIB = [1, 2];
-while (FIB [FIB . length - 1] + FIB [FIB . length - 2] < N) {
+while (FIB [FIB . length - 1] + FIB [FIB . length - 2] <= N) {
FIB . push (FIB [FIB . length - 1] + FIB [FIB . length - 2]);
}
diff --git a/challenge-077/abigail/Part1/solution.pl b/challenge-077/abigail/Part1/solution.pl
index 5e6856b6d8..b39028c5b9 100644
--- a/challenge-077/abigail/Part1/solution.pl
+++ b/challenge-077/abigail/Part1/solution.pl
@@ -36,7 +36,7 @@ chomp (my $N = <>);
# we cannot duplicate numbers, so we just need one 1.
#
my @FIB = (1, 2);
-while ($FIB [-1] + $FIB [-2] < $N) {
+while ($FIB [-1] + $FIB [-2] <= $N) {
push @FIB => $FIB [-1] + $FIB [-2];
}