From 6d055723a8d7c8ed7f1a797e3539ac797e9b74e3 Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Wed, 16 Mar 2016 14:17:27 -0700 Subject: [PATCH] Make Repeat a String function name unique --- .../basic-bonfires.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/seed/challenges/01-front-end-development-certification/basic-bonfires.json b/seed/challenges/01-front-end-development-certification/basic-bonfires.json index 8a77de4f6d3..7f7d1deb60a 100644 --- a/seed/challenges/01-front-end-development-certification/basic-bonfires.json +++ b/seed/challenges/01-front-end-development-certification/basic-bonfires.json @@ -365,25 +365,25 @@ "Remember to use Read-Search-Ask if you get stuck. Write your own code." ], "challengeSeed": [ - "function repeat(str, num) {", + "function repeatStringNumTimes(str, num) {", " // repeat after me", " return str;", "}", "", - "repeat(\"abc\", 3);" + "repeatStringNumTimes(\"abc\", 3);" ], "tests": [ - "assert(repeat(\"*\", 3) === \"***\", 'message: repeat(\"*\", 3) should return \"***\".');", - "assert(repeat(\"abc\", 3) === \"abcabcabc\", 'message: repeat(\"abc\", 3) should return \"abcabcabc\".');", - "assert(repeat(\"abc\", 4) === \"abcabcabcabc\", 'message: repeat(\"abc\", 4) should return \"abcabcabcabc\".');", - "assert(repeat(\"abc\", 1) === \"abc\", 'message: repeat(\"abc\", 1) should return \"abc\".');", - "assert(repeat(\"*\", 8) === \"********\", 'message: repeat(\"*\", 8) should return \"********\".');", - "assert(repeat(\"abc\", -2) === \"\", 'message: repeat(\"abc\", -2) should return \"\".');" + "assert(repeatStringNumTimes(\"*\", 3) === \"***\", 'message: repeatStringNumTimes(\"*\", 3) should return \"***\".');", + "assert(repeatStringNumTimes(\"abc\", 3) === \"abcabcabc\", 'message: repeatStringNumTimes(\"abc\", 3) should return \"abcabcabc\".');", + "assert(repeatStringNumTimes(\"abc\", 4) === \"abcabcabcabc\", 'message: repeatStringNumTimes(\"abc\", 4) should return \"abcabcabcabc\".');", + "assert(repeatStringNumTimes(\"abc\", 1) === \"abc\", 'message: repeatStringNumTimes(\"abc\", 1) should return \"abc\".');", + "assert(repeatStringNumTimes(\"*\", 8) === \"********\", 'message: repeatStringNumTimes(\"*\", 8) should return \"********\".');", + "assert(repeatStringNumTimes(\"abc\", -2) === \"\", 'message: repeatStringNumTimes(\"abc\", -2) should return \"\".');" ], "type": "bonfire", "isRequired": true, "solutions": [ - "function repeat(str, num) {\n if (num < 0) return '';\n return num === 1 ? str : str + repeat(str, num-1);\n}\n\nrepeat('abc', 3);\n" + "function repeatStringNumTimes(str, num) {\n if (num < 0) return '';\n return num === 1 ? str : str + repeatStringNumTimes(str, num-1);\n}\n\nrepeatStringNumTimes('abc', 3);\n" ], "MDNlinks": [ "Global String Object"