Last active
          July 6, 2019 23:15 
        
      - 
      
- 
        Save proudlygeek/da6e0f55ecb476619051 to your computer and use it in GitHub Desktop. 
Revisions
- 
        proudlygeek revised this gist Jul 14, 2014 . 1 changed file with 23 additions and 28 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,39 +1,34 @@ // http://www.codewars.com/kata/525f3eda17c7cd9f9e000b39/train/javascript function recur(n, op) { return (op) ? op.call(op, n) : n; } function zero(op) { return recur(0, op); } function one(op) { return recur(1, op); } function two(op) { return recur(2, op); } function three(op) { return recur(3, op); } function four(op) { return recur(4, op); } function five(op) { return recur(5, op); } function six(op) { return recur(6, op); } function seven(op) { return recur(7, op); } function eight(op) { return recur(8, op); } function nine(op) { return recur(9, op); } function plus(num) { return function(res) { return res + num; }; } function minus(num) { return function(res) { return res - num; }; } function times(num) { return function(res) { return res * num; }; } function dividedBy(num) { return function(res) { return res / num; }; } 
- 
        proudlygeek revised this gist Jul 14, 2014 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,8 @@ function recur(n, op) { return (op) ? op.call(op, n) :n; } function zero(op) { return recur(0, op); } @@ -33,7 +33,7 @@ function times(num) { }; } function dividedBy(num) { return function(res) { return res / num; }; } 
- 
        proudlygeek created this gist Jul 14, 2014 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ // http://www.codewars.com/kata/525f3eda17c7cd9f9e000b39/train/javascript function recur(n, op) { return (op) ? op.call(op, n) : n; } function zero(op) { return recur(0, op); } function one(op) { return recur(1, op); } function two(op) { return recur(2, op); } function three(op) { return recur(3, op); } function four(op) { return recur(4, op); } function five(op) { return recur(5, op); } function six(op) { return recur(6, op); } function seven(op) { return recur(7, op); } function eight(op) { return recur(8, op); } function nine(op) { return recur(9, op); } function plus(num) { return function(res) { return res + num; }; } function minus(num) { return function(res) { return res - num; }; } function times(num) { return function(res) { return res * num; }; } function dividedBy(num) { return function(res) { return res / num; }; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ Test.assertEquals(one(plus(one())), 2); Test.assertEquals(two(times(three())), 6); Test.assertEquals(seven(times(five())), 35); Test.assertEquals(four(plus(nine())), 13); Test.assertEquals(eight(minus(three())), 5); Test.assertEquals(six(dividedBy(two())), 3);