4 kyu

Fluent Calculator

1,758 of 1,828lukasz-lysik

Description:

The Kata is inspired by Calculating with Functions Kata for JavaScript.

The goal is to implement simple calculator which uses fluent syntax:

Calc.new.one.plus.two             # Should return 3
Calc.new.five.minus.six           # Should return -1
Calc.new.seven.times.two          # Should return 14
Calc.new.nine.divided_by.three     # Should return 3

There are only four operations that are supported (plus, minus, times, divided_by) and 10 digits (zero, one, two, three, four, five, six, seven, eight, nine).

Each calculation consists of one operation only.

Mathematics
Metaprogramming

Similar Kata:

Stats:

CreatedDec 6, 2013
PublishedDec 6, 2013
Warriors Trained3910
Total Skips1260
Total Code Submissions7071
Total Times Completed1828
Ruby Completions1758
Total Stars123
% of votes with a positive feedback rating95% of 190
Total "Very Satisfied" Votes171
Total "Somewhat Satisfied" Votes18
Total "Not Satisfied" Votes1
Total Rank Assessments7
Average Assessed Rank
4 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
5 kyu
Ad
Contributors
  • lukasz-lysik Avatar
  • jhoffner Avatar
Ad