From 9f2b9d729f4c81c9a616e4b47246ecc1d2c4426a Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 21 Jul 2025 22:56:34 +0530 Subject: [PATCH] fix: remove closure use in earlier stage Remove the min parameter from makeFilter and hardcode the threshold to 54. Update the printed output and applied range to reflect the new threshold. This simplifies the filter function and aligns the output with the expected results. --- stage_descriptions/functions-06-ey3.md | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/stage_descriptions/functions-06-ey3.md b/stage_descriptions/functions-06-ey3.md index 799fcef..2816fdd 100644 --- a/stage_descriptions/functions-06-ey3.md +++ b/stage_descriptions/functions-06-ey3.md @@ -120,9 +120,9 @@ Test Case 4: Input: ``` -fun makeFilter(min) { +fun makeFilter() { fun filter(n) { - if (n < min) { + if (n < 54) { return false; } return true; @@ -141,31 +141,22 @@ fun applyToNumbers(f, count) { } } -var greaterThanX = makeFilter(55); -var greaterThanY = makeFilter(10); +var greaterThanX = makeFilter(); -print "Numbers >= 55:"; -applyToNumbers(greaterThanX, 55 + 5); - -print "Numbers >= 10:"; -applyToNumbers(greaterThanY, 10 + 5); +print "Numbers >= 54:"; +applyToNumbers(greaterThanX, 54 + 6); ``` Expected Output: ``` -Numbers >= 55: +Numbers >= 54: +54 55 56 57 58 59 -Numbers >= 10: -10 -11 -12 -13 -14 ``` The tester will assert that the stdout of your program matches the format above, and that the exit code is 0.