Merge pull request #13487 from Manish-Giri/fix/improve-oboe-errors-challenge

Improve oboe-errors challenge
This commit is contained in:
Eric Leung
2017-02-20 23:05:16 -08:00
committed by GitHub

View File

@ -294,7 +294,9 @@
"function countToFive() {", "function countToFive() {",
" let firstFive = \"12345\";", " let firstFive = \"12345\";",
" let len = firstFive.length;", " let len = firstFive.length;",
" // Fix the line below",
" for (let i = 1; i <= len; i++) {", " for (let i = 1; i <= len; i++) {",
" // Do not alter code below this line",
" console.log(firstFive[i]);", " console.log(firstFive[i]);",
" }", " }",
"}", "}",
@ -303,9 +305,9 @@
], ],
"tests": [ "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*?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\\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": [], "solutions": [],
"hints": [], "hints": [],
@ -386,4 +388,4 @@
"translations": {} "translations": {}
} }
] ]
} }