From f2af5371a373f7e86645db8cc4776263d48ac849 Mon Sep 17 00:00:00 2001 From: MANISH-GIRI Date: Mon, 20 Feb 2017 19:57:05 -0500 Subject: [PATCH] Improve oboe-errors challenge --- .../debugging.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/challenges/02-javascript-algorithms-and-data-structures/debugging.json b/challenges/02-javascript-algorithms-and-data-structures/debugging.json index 6a8fbd28451..0b664f7bf80 100644 --- a/challenges/02-javascript-algorithms-and-data-structures/debugging.json +++ b/challenges/02-javascript-algorithms-and-data-structures/debugging.json @@ -294,7 +294,9 @@ "function countToFive() {", " let firstFive = \"12345\";", " let len = firstFive.length;", + " // Fix the line below", " for (let i = 1; i <= len; i++) {", + " // Do not alter code below this line", " console.log(firstFive[i]);", " }", "}", @@ -303,9 +305,9 @@ ], "tests": [ "assert(code.match(/i\\s*?=\\s*?0\\s*?;/g).length == 1, 'message: Your code should set the initial condition of the loop so it starts at the first index.');", - "assert(!code.match(/i\\s?=\\s*?1\\s*?;/g), 'message: Your code should fix the initial condition of the loop.');", + "assert(!code.match(/i\\s?=\\s*?1\\s*?;/g), 'message: Your code should fix the initial condition of the loop so that the index starts at 0.');", "assert(code.match(/i\\s*?<\\s*?len\\s*?;/g).length == 1, 'message: Your code should set the terminal condition of the loop so it stops at the last index.');", - "assert(!code.match(/i\\s*?<=\\s*?len;/g), 'message: Your code should fix the terminal condition of the loop.');" + "assert(!code.match(/i\\s*?<=\\s*?len;/g), 'message: Your code should fix the terminal condition of the loop so that it stops at 1 before the length.');" ], "solutions": [], "hints": [], @@ -386,4 +388,4 @@ "translations": {} } ] -} \ No newline at end of file +}