Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
raised as issue
Translation added to https://www.codewars.com/kata/fluent-calculator-1
Do I un-publish this Kata now to close it?
They are the same thing
You need to clear
s
because you are returningthis
which is not necessary if you return a new object without modifyings
Will do
Actually no error, because this is not tested at all.
That's another thing the description did not specify and which there are no tests for. aka:
Actually it's not
clear expression while calling Result
butobtain a new object while doing every operators
Duplicate of https://www.codewars.com/kata/fluent-calculator and https://www.codewars.com/kata/fluent-calculator-1. You should make a translation to those katas instead.
It's not mentioned in the description that calling
Result
should clear the stored expression so far.Should it be a CompileTimeError or RuntimeError?
I suggest updating the description to "Create a simple calculator that given a string of operators () + - * / and numbers separated by spaces returns the value of that expression".
It caused some confusion initially, given that the Sample Test Cases don't reflect the submission ones.
I'd consider adding these test cases to the sample ones:
[TestCase("2 / 2 + 3 * 4.75 - -6", ExpectedResult = 21.25)]
[TestCase("(2+2)(4)", ExpectedResult = 16)]
[TestCase("12-1", ExpectedResult = -12)]
[TestCase("((80 - (19)))", ExpectedResult = 61)]
[TestCase("12 * 123 / -(-5 + 2)", ExpectedResult = 492)]