Last active
          April 29, 2017 22:18 
        
      - 
      
- 
        Save thomascothran/51aa8fa9ac3d99aa00c44c37b31b18b2 to your computer and use it in GitHub Desktop. 
Revisions
- 
        Thomas revised this gist Apr 29, 2017 . 1 changed file with 1 addition and 1 deletion.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,7 +1,7 @@ const nums = {I: 1, V: 5, X: 10, L: 50, C: 100, M: 1000}; const arabify2 = (romNum, sum=0) => { const [fst, snd, rest] = [romNum[0], romNum[1], romNum.slice(2)]; if (!snd) {return nums[fst] ? nums[fst] + sum : sum;} else if (nums[snd] > nums[fst]) { return arabify2(rest, nums[snd] - nums[fst] + sum); 
- 
        Thomas created this gist Apr 29, 2017 .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,9 @@ const nums = {I: 1, V: 5, X: 10, L: 50, C: 100, M: 1000}; const arabify2 = (romNum, sum=0) => { [fst, snd, rest] = [romNum[0], romNum[1], romNum.slice(2)]; if (!snd) {return nums[fst] ? nums[fst] + sum : sum;} else if (nums[snd] > nums[fst]) { return arabify2(rest, nums[snd] - nums[fst] + sum); } else {return arabify2(snd + rest, nums[fst] + sum);} } 
 Thomas
              revised
            
            this gist
            
              Thomas
              revised
            
            this gist