From 8f3e2b2219eadca013627a6c16414229ed3bcd0c Mon Sep 17 00:00:00 2001 From: eliaahadi Date: Tue, 17 Oct 2017 13:51:39 -0700 Subject: [PATCH 01/19] reverse string --- exercises/.DS_Store | Bin 0 -> 6148 bytes exercises/reverse-string/.DS_Store | Bin 0 -> 6148 bytes exercises/reverse-string/README.md | 106 ++++++++++++++++++ .../reverse-string/canonical-schema.json | 54 +++++++++ exercises/reverse-string/metadata.yml | 5 + 5 files changed, 165 insertions(+) create mode 100644 exercises/.DS_Store create mode 100644 exercises/reverse-string/.DS_Store create mode 100644 exercises/reverse-string/README.md create mode 100644 exercises/reverse-string/canonical-schema.json create mode 100644 exercises/reverse-string/metadata.yml diff --git a/exercises/.DS_Store b/exercises/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..c863845391d7bf17401696baeb0e26eae2574f73 GIT binary patch literal 6148 zcmeHKQA+|r5S~@5lc;~UXuGf)bxhu|=K=q)hnp+fIa^uX@q?o`T*`x*6*`Um}; zW_DLmtezr5W?=T4ot@cbzdd$t0YFp-tr9>E04!9(R2G{rgvLpiBxO8=Ld_9E1Z_CL zHeQNm$A4si&Tbn*JhdU}{P~68fe#&b6!qO+;9}gn+wXZ%Tr7TwR64V^zF}pvR(8v} zuXlq{J$B+jRCU5z)$>|y*VtD<(3{zgd+oJHjoj{8;Kz>Vx5K&cyBp7M1*2*(@LQ3Z z=hBJ0n5!0QqUD z;1u4__;Js}dg%88zk_kpIi|Uc%m6dM46FhJ=5Dh#S79@}2WEg7_*Dkzevqhyw!uWB zx;n6--$xqH5R#xxZwW$a&^DN8#1RysQxSElFi#Aj)6p+YoNX}CsMA5Hm2n=kvM?_c zp;kw~RN)|OjodN=%)lZ8Y2D3H{XhTy{lA#RJ!XIzSSbcXrdF?2aZ9GQE^Ur#twe32 ql2BZtah8IHD#aK}rFaij3Hl`&h_=B*BYIHyM?lfQ4Kwhk415B5`d04% literal 0 HcmV?d00001 diff --git a/exercises/reverse-string/.DS_Store b/exercises/reverse-string/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0.spec.js + +Replace `` with the name of the current exercise. E.g., to +test the Reverse String exercise: + + jasmine reverse-string.spec.js + +In many test suites all but the first test have been skipped. + +Once you get a test passing, you can unskip the next one by +changing `xit` to `it`. + +## Source + +This is an exercise to introduce users to using Exercism and arrays and strings [https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb](https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/reverse-string/canonical-schema.json b/exercises/reverse-string/canonical-schema.json new file mode 100644 index 0000000000..33cc26ecea --- /dev/null +++ b/exercises/reverse-string/canonical-schema.json @@ -0,0 +1,54 @@ +{ + "exercise": "revere-string", + "version": "1.0.1", + "comments": [ + "The string argument cases possible matches are passed in as", + "individual arguments rather than arrays. Languages can include", + "these string argument cases if passing individual arguments is", + "idiomatic in that language." + ], + "cases": [ + { + "description": "no matches", + "property": "reverse-string", + "subject": "car", + "candidates": ["girl", "Japan", "bear", "candy"], + "expected": [] + }, + { + "description": "detects simple reverse string", + "property": "reverse-string", + "subject": "ant", + "candidates": ["tna"], + "expected": ["tan"] + }, + { + "description": "detects reverse-string", + "property": "reverse-string", + "subject": "listen", + "candidates": ["netsil"], + "expected": ["netsil"] + }, + { + "description": "detects anagrams case-insensitively", + "property": "reverse-string", + "subject": "NinJa", + "candidates": ["ajnin"], + "expected": ["ajnin"] + }, + { + "description": "matches() accepts string arguments", + "property": "reverse-string", + "subject": "ant", + "candidates": ["tna"], + "expected": ["tna"] + }, + { + "description": "matches() accepts single string argument", + "property": "reverse-string", + "subject": "ant", + "candidates": ["ant"], + "expected": ["tna"] + } + ] +} \ No newline at end of file diff --git a/exercises/reverse-string/metadata.yml b/exercises/reverse-string/metadata.yml new file mode 100644 index 0000000000..5ae26bf0e5 --- /dev/null +++ b/exercises/reverse-string/metadata.yml @@ -0,0 +1,5 @@ +--- +blurb: "Given a string, reverse it’s letters and output a new string." +title: "reverse-string" +source: "Common introductory challenge to learn loops and strings" +source_url: "https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb" \ No newline at end of file From ad599edeaefa8085e7a08cced61382d760a8550c Mon Sep 17 00:00:00 2001 From: eliaahadi Date: Wed, 18 Oct 2017 09:57:50 -0700 Subject: [PATCH 02/19] updates per #960 --- .../reverse-string/canonical-schema.json | 50 ++----------------- .../{README.md => description.md} | 4 +- exercises/reverse-string/metadata.yml | 2 +- 3 files changed, 6 insertions(+), 50 deletions(-) rename exercises/reverse-string/{README.md => description.md} (94%) diff --git a/exercises/reverse-string/canonical-schema.json b/exercises/reverse-string/canonical-schema.json index 33cc26ecea..3e687d2ea6 100644 --- a/exercises/reverse-string/canonical-schema.json +++ b/exercises/reverse-string/canonical-schema.json @@ -1,54 +1,12 @@ { - "exercise": "revere-string", - "version": "1.0.1", - "comments": [ - "The string argument cases possible matches are passed in as", - "individual arguments rather than arrays. Languages can include", - "these string argument cases if passing individual arguments is", - "idiomatic in that language." - ], + "exercise": "reverse-string", + "version": "1.0.0", "cases": [ - { - "description": "no matches", - "property": "reverse-string", - "subject": "car", - "candidates": ["girl", "Japan", "bear", "candy"], - "expected": [] - }, - { - "description": "detects simple reverse string", - "property": "reverse-string", - "subject": "ant", - "candidates": ["tna"], - "expected": ["tan"] - }, { "description": "detects reverse-string", "property": "reverse-string", - "subject": "listen", - "candidates": ["netsil"], - "expected": ["netsil"] - }, - { - "description": "detects anagrams case-insensitively", - "property": "reverse-string", - "subject": "NinJa", - "candidates": ["ajnin"], - "expected": ["ajnin"] - }, - { - "description": "matches() accepts string arguments", - "property": "reverse-string", - "subject": "ant", - "candidates": ["tna"], - "expected": ["tna"] - }, - { - "description": "matches() accepts single string argument", - "property": "reverse-string", - "subject": "ant", - "candidates": ["ant"], - "expected": ["tna"] + "input": "robot", "superman", "ramen", + "expected": ["tobor", "namrepus", "nemar"] } ] } \ No newline at end of file diff --git a/exercises/reverse-string/README.md b/exercises/reverse-string/description.md similarity index 94% rename from exercises/reverse-string/README.md rename to exercises/reverse-string/description.md index 7b046b5b84..6808e4c42b 100644 --- a/exercises/reverse-string/README.md +++ b/exercises/reverse-string/description.md @@ -1,6 +1,6 @@ # Reverse String -The introductory exercise to arrays and strings. Just reverse input string. +The introductory exercise to reverse an input string. This is a typical first program for beginning programming in a new language or environment after being able to do simple tasks. @@ -11,8 +11,6 @@ The objectives are simple: - Run the test suite and make sure that it succeeds. - Submit your solution and check it at the website. -If everything goes well, you will be ready to fetch your first real exercise. - ## Tutorial This exercise has two files: diff --git a/exercises/reverse-string/metadata.yml b/exercises/reverse-string/metadata.yml index 5ae26bf0e5..d924616308 100644 --- a/exercises/reverse-string/metadata.yml +++ b/exercises/reverse-string/metadata.yml @@ -1,5 +1,5 @@ --- blurb: "Given a string, reverse it’s letters and output a new string." title: "reverse-string" -source: "Common introductory challenge to learn loops and strings" +source: "Common introductory challenge to reverse an input string" source_url: "https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb" \ No newline at end of file From 7accf3c0ba7a4bf0719cd5efd24fd925787eab62 Mon Sep 17 00:00:00 2001 From: eliaahadi Date: Wed, 18 Oct 2017 10:22:29 -0700 Subject: [PATCH 03/19] delete DS store --- exercises/reverse-string/.DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 exercises/reverse-string/.DS_Store diff --git a/exercises/reverse-string/.DS_Store b/exercises/reverse-string/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 Date: Wed, 18 Oct 2017 13:59:03 -0700 Subject: [PATCH 04/19] updated test cases mostly --- exercises/.DS_Store | Bin 6148 -> 0 bytes .../reverse-string/canonical-schema.json | 18 +++- exercises/reverse-string/description.md | 92 ------------------ exercises/reverse-string/metadata.yml | 2 +- 4 files changed, 16 insertions(+), 96 deletions(-) delete mode 100644 exercises/.DS_Store diff --git a/exercises/.DS_Store b/exercises/.DS_Store deleted file mode 100644 index c863845391d7bf17401696baeb0e26eae2574f73..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKQA+|r5S~@5lc;~UXuGf)bxhu|=K=q)hnp+fIa^uX@q?o`T*`x*6*`Um}; zW_DLmtezr5W?=T4ot@cbzdd$t0YFp-tr9>E04!9(R2G{rgvLpiBxO8=Ld_9E1Z_CL zHeQNm$A4si&Tbn*JhdU}{P~68fe#&b6!qO+;9}gn+wXZ%Tr7TwR64V^zF}pvR(8v} zuXlq{J$B+jRCU5z)$>|y*VtD<(3{zgd+oJHjoj{8;Kz>Vx5K&cyBp7M1*2*(@LQ3Z z=hBJ0n5!0QqUD z;1u4__;Js}dg%88zk_kpIi|Uc%m6dM46FhJ=5Dh#S79@}2WEg7_*Dkzevqhyw!uWB zx;n6--$xqH5R#xxZwW$a&^DN8#1RysQxSElFi#Aj)6p+YoNX}CsMA5Hm2n=kvM?_c zp;kw~RN)|OjodN=%)lZ8Y2D3H{XhTy{lA#RJ!XIzSSbcXrdF?2aZ9GQE^Ur#twe32 ql2BZtah8IHD#aK}rFaij3Hl`&h_=B*BYIHyM?lfQ4Kwhk415B5`d04% diff --git a/exercises/reverse-string/canonical-schema.json b/exercises/reverse-string/canonical-schema.json index 3e687d2ea6..90b60929c8 100644 --- a/exercises/reverse-string/canonical-schema.json +++ b/exercises/reverse-string/canonical-schema.json @@ -5,8 +5,20 @@ { "description": "detects reverse-string", "property": "reverse-string", - "input": "robot", "superman", "ramen", - "expected": ["tobor", "namrepus", "nemar"] - } + "input": "robot", + "expected": "tobor" + }, + { + "description": "detects empty string", + "property": "reverse-string", + "input": "", + "expected": "String is empty, input valid string" + }, + { + "description": "detects reverse-string twice and check if it's original string", + "property": "reverse-string", + "input": "robot", + "expected": "robot" + }, ] } \ No newline at end of file diff --git a/exercises/reverse-string/description.md b/exercises/reverse-string/description.md index 6808e4c42b..fc9b421a61 100644 --- a/exercises/reverse-string/description.md +++ b/exercises/reverse-string/description.md @@ -10,95 +10,3 @@ The objectives are simple: - Write a function that reverses the input string. - Run the test suite and make sure that it succeeds. - Submit your solution and check it at the website. - -## Tutorial - -This exercise has two files: - -- reverse-string.js -- reverse-string.spec.js - -The first file is where you will write your code. -The second is where the tests are defined. - -The tests will check whether your code is doing the right thing. -You don't need to be able to write a test suite from scratch, -but it helps to understand what a test looks like, and what -it is doing. - -Open up the test file, reverse-string.spec.js. -There is one test inside: - - xit('detects simple reverse string', function () { - var subject = new ReverseString('ant'); - var matches = subject.matches(['tna']); - - expect(matches).toEqual(['tna']); - }); - -Run the test now, with the following command on the command-line: - - jasmine reverse-string.spec.js - -The test fails, which makes sense since you've not written any code yet. - -The failure looks like this: - - 1) Reverse String says reverse string - Message: - Expected undefined to equal 'tna'. - -There's more, but this is the most important part. - -Take a look at that first line: - - 1) Reverse String says reverse string - -Now look at the test definition again: - - it('detects simple reverse string', function() { - // ... more code here ... - }); - -Update the code and then run the tests again from the command-line: - - jasmine reverse-string.spec.js - -Notice how it changes the failure message. - -Then change the implementation in reverse-string.js again, this time to make the test pass. - -When you are done, submit your solution to exercism: - - exercism submit reverse-string.js - - -## Setup - -Go through the setup instructions for JavaScript to -install the necessary dependencies: - -http://exercism.io/languages/javascript - -## Making the Test Suite Pass - -Execute the tests with: - - jasmine .spec.js - -Replace `` with the name of the current exercise. E.g., to -test the Reverse String exercise: - - jasmine reverse-string.spec.js - -In many test suites all but the first test have been skipped. - -Once you get a test passing, you can unskip the next one by -changing `xit` to `it`. - -## Source - -This is an exercise to introduce users to using Exercism and arrays and strings [https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb](https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb) - -## Submitting Incomplete Solutions -It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/exercises/reverse-string/metadata.yml b/exercises/reverse-string/metadata.yml index d924616308..d9b48169e0 100644 --- a/exercises/reverse-string/metadata.yml +++ b/exercises/reverse-string/metadata.yml @@ -1,5 +1,5 @@ --- -blurb: "Given a string, reverse it’s letters and output a new string." +blurb: "Given a string, reverse its letters and output a new string." title: "reverse-string" source: "Common introductory challenge to reverse an input string" source_url: "https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb" \ No newline at end of file From 6ed698d285649e27e26507c185ecc4216b6474cf Mon Sep 17 00:00:00 2001 From: eliaahadi Date: Wed, 18 Oct 2017 15:20:28 -0700 Subject: [PATCH 05/19] added edits to test cases --- .../reverse-string/canonical-schema.json | 42 ++++++++++++++++--- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/exercises/reverse-string/canonical-schema.json b/exercises/reverse-string/canonical-schema.json index 90b60929c8..e6e087b13c 100644 --- a/exercises/reverse-string/canonical-schema.json +++ b/exercises/reverse-string/canonical-schema.json @@ -3,20 +3,50 @@ "version": "1.0.0", "cases": [ { - "description": "detects reverse-string", + "description": "empty string", + "property": "reverse-string", + "input": "", + "expected": "" + }, + { + "description": "reverse a single character string", + "property": "reverse-string", + "input": "e", + "expected": "e" + }, + { + "description": "reverse a string", "property": "reverse-string", "input": "robot", "expected": "tobor" }, { - "description": "detects empty string", + "description": "reverse a string consisting of a single lowercase letter", "property": "reverse-string", - "input": "", - "expected": "String is empty, input valid string" + "input": "WOLf", + "expected": "fLOW" + }, + { + "description": "reverse a string having more than a single lowercase letter", + "property": "reverse-string", + "input": "DEssERTS", + "expected": "STREssED" + }, + { + "description": "reverse a string with at least a capital letter", + "property": "reverse-string", + "input": "Ramen", + "expected": "nemaR" }, - { - "description": "detects reverse-string twice and check if it's original string", + { + "description": "reverse a string that contains a proper sentence with punctuation.", "property": "reverse-string", + "input": "I'm hungry!", + "expected": "!yrgnuh m'I" + }, + { + "description": "reverse a string twice and check if it's original string", + "property": "reverse-string twice", "input": "robot", "expected": "robot" }, From 300a3e08b68cb26569f8b5bdbce6f23a4ebcf513 Mon Sep 17 00:00:00 2001 From: eliaahadi Date: Fri, 20 Oct 2017 11:00:55 -0700 Subject: [PATCH 06/19] updates JSON and description files --- .../reverse-string/canonical-schema.json | 28 ++++--------------- exercises/reverse-string/description.md | 6 +++- 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/exercises/reverse-string/canonical-schema.json b/exercises/reverse-string/canonical-schema.json index e6e087b13c..e9b3e4e81b 100644 --- a/exercises/reverse-string/canonical-schema.json +++ b/exercises/reverse-string/canonical-schema.json @@ -7,12 +7,6 @@ "property": "reverse-string", "input": "", "expected": "" - }, - { - "description": "reverse a single character string", - "property": "reverse-string", - "input": "e", - "expected": "e" }, { "description": "reverse a string", @@ -20,18 +14,6 @@ "input": "robot", "expected": "tobor" }, - { - "description": "reverse a string consisting of a single lowercase letter", - "property": "reverse-string", - "input": "WOLf", - "expected": "fLOW" - }, - { - "description": "reverse a string having more than a single lowercase letter", - "property": "reverse-string", - "input": "DEssERTS", - "expected": "STREssED" - }, { "description": "reverse a string with at least a capital letter", "property": "reverse-string", @@ -39,16 +21,16 @@ "expected": "nemaR" }, { - "description": "reverse a string that contains a proper sentence with punctuation.", + "description": "reverse a string that contains a proper sentence with punctuation", "property": "reverse-string", "input": "I'm hungry!", "expected": "!yrgnuh m'I" }, { - "description": "reverse a string twice and check if it's original string", - "property": "reverse-string twice", - "input": "robot", - "expected": "robot" + "description": "reverse a string and check if it is the same as input string (Palindrome)", + "property": "reverse-string", + "input": "racecar", + "expected": "racecar" }, ] } \ No newline at end of file diff --git a/exercises/reverse-string/description.md b/exercises/reverse-string/description.md index fc9b421a61..c8c192e1b6 100644 --- a/exercises/reverse-string/description.md +++ b/exercises/reverse-string/description.md @@ -2,11 +2,15 @@ The introductory exercise to reverse an input string. -This is a typical first program for beginning programming in a new language +This is a typical program for beginning programming in a new language or environment after being able to do simple tasks. The objectives are simple: - Write a function that reverses the input string. +- Test various mixed case inputs and output the reverse of them. - Run the test suite and make sure that it succeeds. - Submit your solution and check it at the website. + +Comments: +If testing tools are available, a property that can be tested is to reverse string twice and see if the output is the original string. \ No newline at end of file From 4decbde7f964aec61da51745c3f3044cfefbb196 Mon Sep 17 00:00:00 2001 From: eliaahadi Date: Sat, 21 Oct 2017 19:15:17 -0700 Subject: [PATCH 07/19] updated comments --- exercises/reverse-string/canonical-schema.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/exercises/reverse-string/canonical-schema.json b/exercises/reverse-string/canonical-schema.json index e9b3e4e81b..cc814077bd 100644 --- a/exercises/reverse-string/canonical-schema.json +++ b/exercises/reverse-string/canonical-schema.json @@ -1,6 +1,10 @@ { "exercise": "reverse-string", - "version": "1.0.0", + "version": "1.0.0", + "comments": [ + "If property based testing tools are available, a good property to test is:" + ``` reverse(reverse(str)) == str ``` + ], "cases": [ { "description": "empty string", @@ -31,6 +35,6 @@ "property": "reverse-string", "input": "racecar", "expected": "racecar" - }, + } ] } \ No newline at end of file From 531587e0d9e2bbdcd456899edb501d2e096fa7e8 Mon Sep 17 00:00:00 2001 From: eliaahadi Date: Tue, 24 Oct 2017 09:38:20 -0700 Subject: [PATCH 08/19] rename json and comment edits --- .../{canonical-schema.json => canonical-data.json} | 4 ++-- exercises/reverse-string/description.md | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) rename exercises/reverse-string/{canonical-schema.json => canonical-data.json} (91%) diff --git a/exercises/reverse-string/canonical-schema.json b/exercises/reverse-string/canonical-data.json similarity index 91% rename from exercises/reverse-string/canonical-schema.json rename to exercises/reverse-string/canonical-data.json index cc814077bd..aad55ae161 100644 --- a/exercises/reverse-string/canonical-schema.json +++ b/exercises/reverse-string/canonical-data.json @@ -2,8 +2,8 @@ "exercise": "reverse-string", "version": "1.0.0", "comments": [ - "If property based testing tools are available, a good property to test is:" - ``` reverse(reverse(str)) == str ``` + "If property based testing tools are available, a good property to test is reversing a string twice: " + " reverse(reverse(string)) == string " ], "cases": [ { diff --git a/exercises/reverse-string/description.md b/exercises/reverse-string/description.md index c8c192e1b6..70d5e7cab5 100644 --- a/exercises/reverse-string/description.md +++ b/exercises/reverse-string/description.md @@ -12,5 +12,3 @@ The objectives are simple: - Run the test suite and make sure that it succeeds. - Submit your solution and check it at the website. -Comments: -If testing tools are available, a property that can be tested is to reverse string twice and see if the output is the original string. \ No newline at end of file From 4c926c4d92b95187ae3829ca618f16c210b27447 Mon Sep 17 00:00:00 2001 From: eliaahadi Date: Wed, 25 Oct 2017 07:52:12 -0700 Subject: [PATCH 09/19] updated comments --- exercises/reverse-string/canonical-data.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/exercises/reverse-string/canonical-data.json b/exercises/reverse-string/canonical-data.json index aad55ae161..3af80a29be 100644 --- a/exercises/reverse-string/canonical-data.json +++ b/exercises/reverse-string/canonical-data.json @@ -2,8 +2,7 @@ "exercise": "reverse-string", "version": "1.0.0", "comments": [ - "If property based testing tools are available, a good property to test is reversing a string twice: " - " reverse(reverse(string)) == string " + "If property based testing tools are available, a good property to test is reversing a string twice: reverse(reverse(string)) == string" ], "cases": [ { From b10dcb919e14a0ff3edee753fe467f3210a9573b Mon Sep 17 00:00:00 2001 From: eliaahadi Date: Thu, 26 Oct 2017 08:01:26 -0700 Subject: [PATCH 10/19] rename property to reverse --- exercises/reverse-string/canonical-data.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/reverse-string/canonical-data.json b/exercises/reverse-string/canonical-data.json index 3af80a29be..b71cb445b8 100644 --- a/exercises/reverse-string/canonical-data.json +++ b/exercises/reverse-string/canonical-data.json @@ -7,31 +7,31 @@ "cases": [ { "description": "empty string", - "property": "reverse-string", + "property": "reverse", "input": "", "expected": "" }, { "description": "reverse a string", - "property": "reverse-string", + "property": "reverse", "input": "robot", "expected": "tobor" }, { "description": "reverse a string with at least a capital letter", - "property": "reverse-string", + "property": "reverse", "input": "Ramen", "expected": "nemaR" }, { "description": "reverse a string that contains a proper sentence with punctuation", - "property": "reverse-string", + "property": "reverse", "input": "I'm hungry!", "expected": "!yrgnuh m'I" }, { "description": "reverse a string and check if it is the same as input string (Palindrome)", - "property": "reverse-string", + "property": "reverse", "input": "racecar", "expected": "racecar" } From 4807fe1cf6211c7cb65ce0cf45c4f79300300183 Mon Sep 17 00:00:00 2001 From: eliaahadi Date: Fri, 27 Oct 2017 12:19:03 -0700 Subject: [PATCH 11/19] simpler description --- exercises/reverse-string/description.md | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/exercises/reverse-string/description.md b/exercises/reverse-string/description.md index 70d5e7cab5..4b3556af30 100644 --- a/exercises/reverse-string/description.md +++ b/exercises/reverse-string/description.md @@ -1,14 +1,7 @@ # Reverse String -The introductory exercise to reverse an input string. - -This is a typical program for beginning programming in a new language -or environment after being able to do simple tasks. - -The objectives are simple: - -- Write a function that reverses the input string. -- Test various mixed case inputs and output the reverse of them. -- Run the test suite and make sure that it succeeds. -- Submit your solution and check it at the website. +The objective is to write a function that reverses the input sequence of characters. +## For Example +input: "cool" +output: "looc" From 57f7581082ada6e75646e863b5bba17ed1e008f1 Mon Sep 17 00:00:00 2001 From: eliaahadi Date: Wed, 1 Nov 2017 14:52:30 -0700 Subject: [PATCH 12/19] update metadata --- .gitignore | 2 ++ exercises/reverse-string/metadata.yml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 3c3629e647..1c11277768 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ node_modules +# Mac +.DS_Store \ No newline at end of file diff --git a/exercises/reverse-string/metadata.yml b/exercises/reverse-string/metadata.yml index d9b48169e0..e6e9c4d7c3 100644 --- a/exercises/reverse-string/metadata.yml +++ b/exercises/reverse-string/metadata.yml @@ -1,5 +1,5 @@ --- -blurb: "Given a string, reverse its letters and output a new string." +blurb: "Reverse a string" title: "reverse-string" -source: "Common introductory challenge to reverse an input string" +source: "Introductory challenge to reverse an input string" source_url: "https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb" \ No newline at end of file From 5eac807bf9ce6d11d584b0bcedb3f680c3032cee Mon Sep 17 00:00:00 2001 From: eliaahadi Date: Tue, 7 Nov 2017 09:30:04 -0800 Subject: [PATCH 13/19] no adds to .gitignore --- exercises/.DS_Store | Bin 0 -> 8196 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 exercises/.DS_Store diff --git a/exercises/.DS_Store b/exercises/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..c34459537dc125580c99369001ba3db598ffd401 GIT binary patch literal 8196 zcmeHLTWl0n7(U-pV1^EKD3w-pvs>0uf+cLB&>$*HyP!ak>bA68q@CRv+tJyXvNO8{ zO37-X(HNq>ffz4|F9t6!3i{|RA?llr1`=P;#LI)4U}8v&@jr8BNo^^_h)EOYB@NMD&O$D?psBcO>MfHHd6hVmrVNUWmS0|bZXjxEU&LGSgf|U_eDDYP&yST5; zkPvP1HjAikH&}`KUn4T7YVN%G zk}ON|Lh0emurr$RG_UA(Xoda$lc^ioVBX_6*44R|-D4V~18QBTV|$uu8-+>g2l`A~ zcSbv$qOH5WpKi??CR=}@0kwW?Y~%Wt_}XOqcuRb&y*=3yZ(Fxvd|Z<1n_BPLKA1mp zbnMvp@snbk2#yL?GiBSSZnS4>s5O&w@*~2oseD6yx6~M!_XIpw_q)!0kE5?k*Ty-j{Q%V%~NK)Wtc?$`vimGqzY( z#yn~eug1+49Lwrfh%&1+UY0)^C!3p`{jG;~|5bnk6Gmu3Z)K znML)nJ65h<+kSUy>qL#ZxK^oCmiCoQ*UVZ*@2IJJ!+SM1XV|)F5ACC`YkTG+rcsa= zqebqqwY)J=+i>f$+is6Wr)pQc^cS<{p`z&>Q4^9R)@Y0-Wc5AifKG3*%h9<<-Iqig zqs@}EpYuBl291KPtcteCswVZgv|Zt1jnXQsuH5q&K}VRjDH|kJmwPQOYgmG{QQ0J^ zJLSHTh`3H*|=cR*u;V#Yfc8?e~t(?n{ynD_xnq>|!Ern@c5*0MC~VuO@pW9$Sw$zEgcva{?Q`ZPvL1i zgXeG(r*IlC;dQ))xA6|%$A|a`pWstW;2V68AMhi7!e#ssnHyOUSt4FDQpuNY@mv`r zbu_!~8DY7l;EafzzBc}2+wQx6`;J+R{|k#a=$F*pva~+lv}#S;#(O)iLSqUVCZo~^ zqClFDzzV{A0Q?=+B0H2=F9Fp!JX4aW^Lau^6I{D-c`T-KIEu#=&GZ5 z4kd%^D<@l(m^znmFQn@?D2iG|i6NwSZ6fJBN&z9=93?3WWYx_vMUrn8oIhh zI6-iJ9xvcUg7eFG1+U@_oWYv}?6WvW!2W=M{W-z<0xnH~aaRSvg5uj7!8q@v(|Xa% zG4|EM^}qX8*M)uF(f^VD$nfNA#m} Date: Tue, 7 Nov 2017 09:53:30 -0800 Subject: [PATCH 14/19] simpler description --- exercises/reverse-string/description.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/exercises/reverse-string/description.md b/exercises/reverse-string/description.md index 4b3556af30..6b4bd8a6fb 100644 --- a/exercises/reverse-string/description.md +++ b/exercises/reverse-string/description.md @@ -1,7 +1,5 @@ -# Reverse String +Reverse a string -The objective is to write a function that reverses the input sequence of characters. - -## For Example +For Example: input: "cool" output: "looc" From 1d08667e6a98d9de7e4a605ecfc2f5648bc8f113 Mon Sep 17 00:00:00 2001 From: eliaahadi Date: Tue, 7 Nov 2017 11:29:32 -0800 Subject: [PATCH 15/19] description & can data edits --- exercises/reverse-string/canonical-data.json | 4 ++-- exercises/reverse-string/description.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/reverse-string/canonical-data.json b/exercises/reverse-string/canonical-data.json index b71cb445b8..11bfae5e2f 100644 --- a/exercises/reverse-string/canonical-data.json +++ b/exercises/reverse-string/canonical-data.json @@ -18,13 +18,13 @@ "expected": "tobor" }, { - "description": "reverse a string with at least a capital letter", + "description": "reverse a string with a capital letter", "property": "reverse", "input": "Ramen", "expected": "nemaR" }, { - "description": "reverse a string that contains a proper sentence with punctuation", + "description": "reverse a string with punctuation", "property": "reverse", "input": "I'm hungry!", "expected": "!yrgnuh m'I" diff --git a/exercises/reverse-string/description.md b/exercises/reverse-string/description.md index 6b4bd8a6fb..473c42f54a 100644 --- a/exercises/reverse-string/description.md +++ b/exercises/reverse-string/description.md @@ -1,5 +1,5 @@ Reverse a string -For Example: +For example: input: "cool" output: "looc" From fcdb93b52df57f1ef3bb602e0e12ec4512c2e3e4 Mon Sep 17 00:00:00 2001 From: eliaahadi Date: Tue, 7 Nov 2017 11:32:27 -0800 Subject: [PATCH 16/19] no gitignore or .DS_store --- .gitignore | 3 --- exercises/.DS_Store | Bin 8196 -> 0 bytes 2 files changed, 3 deletions(-) delete mode 100644 .gitignore delete mode 100644 exercises/.DS_Store diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 1c11277768..0000000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -# Mac -.DS_Store \ No newline at end of file diff --git a/exercises/.DS_Store b/exercises/.DS_Store deleted file mode 100644 index c34459537dc125580c99369001ba3db598ffd401..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeHLTWl0n7(U-pV1^EKD3w-pvs>0uf+cLB&>$*HyP!ak>bA68q@CRv+tJyXvNO8{ zO37-X(HNq>ffz4|F9t6!3i{|RA?llr1`=P;#LI)4U}8v&@jr8BNo^^_h)EOYB@NMD&O$D?psBcO>MfHHd6hVmrVNUWmS0|bZXjxEU&LGSgf|U_eDDYP&yST5; zkPvP1HjAikH&}`KUn4T7YVN%G zk}ON|Lh0emurr$RG_UA(Xoda$lc^ioVBX_6*44R|-D4V~18QBTV|$uu8-+>g2l`A~ zcSbv$qOH5WpKi??CR=}@0kwW?Y~%Wt_}XOqcuRb&y*=3yZ(Fxvd|Z<1n_BPLKA1mp zbnMvp@snbk2#yL?GiBSSZnS4>s5O&w@*~2oseD6yx6~M!_XIpw_q)!0kE5?k*Ty-j{Q%V%~NK)Wtc?$`vimGqzY( z#yn~eug1+49Lwrfh%&1+UY0)^C!3p`{jG;~|5bnk6Gmu3Z)K znML)nJ65h<+kSUy>qL#ZxK^oCmiCoQ*UVZ*@2IJJ!+SM1XV|)F5ACC`YkTG+rcsa= zqebqqwY)J=+i>f$+is6Wr)pQc^cS<{p`z&>Q4^9R)@Y0-Wc5AifKG3*%h9<<-Iqig zqs@}EpYuBl291KPtcteCswVZgv|Zt1jnXQsuH5q&K}VRjDH|kJmwPQOYgmG{QQ0J^ zJLSHTh`3H*|=cR*u;V#Yfc8?e~t(?n{ynD_xnq>|!Ern@c5*0MC~VuO@pW9$Sw$zEgcva{?Q`ZPvL1i zgXeG(r*IlC;dQ))xA6|%$A|a`pWstW;2V68AMhi7!e#ssnHyOUSt4FDQpuNY@mv`r zbu_!~8DY7l;EafzzBc}2+wQx6`;J+R{|k#a=$F*pva~+lv}#S;#(O)iLSqUVCZo~^ zqClFDzzV{A0Q?=+B0H2=F9Fp!JX4aW^Lau^6I{D-c`T-KIEu#=&GZ5 z4kd%^D<@l(m^znmFQn@?D2iG|i6NwSZ6fJBN&z9=93?3WWYx_vMUrn8oIhh zI6-iJ9xvcUg7eFG1+U@_oWYv}?6WvW!2W=M{W-z<0xnH~aaRSvg5uj7!8q@v(|Xa% zG4|EM^}qX8*M)uF(f^VD$nfNA#m} Date: Wed, 8 Nov 2017 10:49:57 -0800 Subject: [PATCH 17/19] case description updates --- exercises/reverse-string/canonical-data.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/reverse-string/canonical-data.json b/exercises/reverse-string/canonical-data.json index 11bfae5e2f..83b6786dd0 100644 --- a/exercises/reverse-string/canonical-data.json +++ b/exercises/reverse-string/canonical-data.json @@ -12,25 +12,25 @@ "expected": "" }, { - "description": "reverse a string", + "description": "a word", "property": "reverse", "input": "robot", "expected": "tobor" }, { - "description": "reverse a string with a capital letter", + "description": "a capitalized word", "property": "reverse", "input": "Ramen", "expected": "nemaR" }, { - "description": "reverse a string with punctuation", - "property": "reverse", + "description": "a sentence with punctuation", + "property": "reverse", "input": "I'm hungry!", "expected": "!yrgnuh m'I" }, { - "description": "reverse a string and check if it is the same as input string (Palindrome)", + "description": "a string that reads the same backward as forward (i.e. palindrome)", "property": "reverse", "input": "racecar", "expected": "racecar" From a32e42a3286ea0a906404fe79525b62c071bfd85 Mon Sep 17 00:00:00 2001 From: eliaahadi Date: Thu, 9 Nov 2017 08:19:04 -0800 Subject: [PATCH 18/19] Restore .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..3c3629e647 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules From 1433c14e76846d09e7bfc5953aae8adf9ddfb9bc Mon Sep 17 00:00:00 2001 From: eliaahadi Date: Fri, 10 Nov 2017 11:20:02 -0800 Subject: [PATCH 19/19] edit to palindrome description --- exercises/reverse-string/canonical-data.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/reverse-string/canonical-data.json b/exercises/reverse-string/canonical-data.json index 83b6786dd0..b3e207a4aa 100644 --- a/exercises/reverse-string/canonical-data.json +++ b/exercises/reverse-string/canonical-data.json @@ -30,7 +30,7 @@ "expected": "!yrgnuh m'I" }, { - "description": "a string that reads the same backward as forward (i.e. palindrome)", + "description": "a palindrome", "property": "reverse", "input": "racecar", "expected": "racecar"