Great Kata in theory IMO but it isn't easy to validate all possible valid solutions in practice (even after arithmetic simplification of expressions). I've already come up with a valid solution about half an hour before I passed all the tests but I was still failing a few test cases because the assertions did not take into account the commutativity (and associativity) of multiplication so I spent quite a bit of time trying to figure out the order in which the multiplication of certain terms should be performed. Other than that, I thoroughly enjoyed solving this Kata, keep up the good work :D

On another note, this Kata had a lot of assertions, some very straightforward and others a bit less straightforward; however, it would have been even better if expressions of the form f(x)^g(x) (in prefix notation, of course) were tested as well - such expressions aren't as frequently covered by typical high school math courses and would definitely get more people thinking ;)

I kept the tests almost as they are for the moment, except I put the random tests in a loop to make more of them

WARNING: your random tests can currently ask for wrong results: the expected answers do not take care of the simplifications so if the random number id 0 or 1, the test with fail even with a correct code. So, I generated numbers between 2 and 99 instead.

I think that's because it's a subset of Lisp this way. First function, then any number of arguments, allowing implementations with no special cases for unary and binary functions.

Okay, re-raising these again since obviously they aren't "issues" according to the author ;-):

The tests expect you to use exactlyIdGenerator.GetId<Post>(); to pass VerifyPostInformation, but it really should be IdGenerator.GetId<IPost>();, or otherwise other implementations of IPost will cause an ID collision

GetPending is not used or tested. In fact, it's unknown what its purpose is given how GetFriends works (which already has a filter). Also, the name of GetPending is confusing: it implies that it also receives all the pending friends, but the comment above suggests that it's actually the friends+pending equivalent of GetFriends (but then it'd also have the incorrect param signature)

Thank you for the suggestion. Filter can be used depending on how you want to solve it. The description is clear that it does not need to be implemented.

Great Kata in theory IMO but it isn't easy to validate

allpossible valid solutions in practice (even after arithmetic simplification of expressions). I've already come up with a valid solution about half an hour before I passed all the tests but I was still failing a few test cases because the assertions did not take into account the commutativity (and associativity) of multiplication so I spent quite a bit of time trying to figure out the order in which the multiplication of certain terms should be performed. Other than that, I thoroughly enjoyed solving this Kata, keep up the good work :DOn another note, this Kata had a lot of assertions, some very straightforward and others a bit less straightforward; however, it would have been even better if expressions of the form

`f(x)^g(x)`

(in prefix notation, of course) were tested as well - such expressions aren't as frequently covered by typical high school math courses and would definitely get more people thinking ;)Confirmed.

should be good, check again, please

Random tests contain

`"sin (* {0} x))"`

missing the open parenthesisGreat! Thank you for the Python translation !

I followed your example and changed the random tests so they wont use 0 or 1 as the random number.

Python translation

Notes:

Thank you for your suggestion. I will look at adding more test cases.

I tried to keep it simple since more complicated expressions will need more simplifying and that can also be challenging to implement.

Hi,

Very interesting one, but it needs more complicated test cases to earn his current rank estimation, imo.

What about things like:

`2x + sin(3 * exp(5x))`

,`3x^-3 + 7x^2 + 25 - ln(2*x^2)`

, ...?ok, thx. I believe I'm overkilling the kata with what I'm implementing now... ;-x

I think that's because it's a subset of Lisp this way. First function, then any number of arguments, allowing implementations with no special cases for unary and binary functions.

Hi,

Why the use of parenthesis while "not infix" notations main interest is they DO NOT need parenthesis...? :o

Thank you. I edited the description and removed the unused method.

Tests will use

`IdGenerator.GetId<IPost>()`

but it is possible to generate id values in a different way in the solution and still pass the tests.Okay, re-raising these again since obviously they aren't "issues" according to the author ;-):

`IdGenerator.GetId<Post>();`

to pass`VerifyPostInformation`

, but it really should be`IdGenerator.GetId<IPost>();`

, or otherwise other implementations of`IPost`

will cause an ID collision`GetPending`

is not used or tested. In fact, it's unknown what its purpose is given how`GetFriends`

works (which already has a`filter`

). Also, the name of`GetPending`

is confusing: it implies that it also receives all the pending friends, but the comment above suggests that it's actually the friends+pending equivalent of`GetFriends`

(but then it'd also have the incorrect param signature)Thank you for the suggestion.

Thank you for the suggestion. Filter can be used depending on how you want to solve it. The description is clear that it does not need to be implemented.

## Loading more items...