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.
Hi,
IMO, The idea is nice but the tests are way too easy..
You could use diffrent amount of spaces between the tags, lower/upper case, etc'.
In addition, I would add some syntax validate (e.g. the function will return None for invalid tags), but this is up to you.
Maybe this is why my solution fails :-(
I've passed the 1500x1500. How far am I?
Nice kata :)
I think that some details are missing in the description -
Submitted by mistake :(
I really enjoy this kata! Thanks :)
You are welcome! It was fun!!
"there is no consensus" - Thie is right, but if you have prec. for each function, we can use it (no matter if it is in the middle or not..). Anyway, it doesn't really matter. It's just need to be clear.
I am looking forward to the more generalized version. Please let me know once it is ready :-)
OK. It took me 5 minutes to fix my solution according to this rules and it works now :) Thanks!
It was fun :) Thanks!
Another example:
Expression: 3¨9,,,¨!(8)
Operators: !(Prefix, 1), ¨(Infix, 3), ,,,(Postfix, 15)
Brackets:
3 ¨ 9 ,,, ¨ ! 8
( 3 ¨ 9 ) ,,, ¨ ! 8
( ( 3 ¨ 9 ) ,,, ) ¨ ( ! 8 )
3.0 ¨ 9.0 = 246.0
(246.0 ,,, ) ¨ ( ! 8 )
Calculation:
246.0 ,,, = 138.33333333333334
138.33333333333334 ¨ (! 8.0)
! 8.0 = 5.208333333333333
138.33333333333334 ¨ 5.208333333333333 = 3079.930555555555
3079.930555555555
3079.930555555555 should equal 4514.180555555555
Sorry, but my problem is earlier. I've tried but sides of associativity....
]]] has higher prec.
Therefore, I create the forst grouping:
(323 [[ 5) ]]] [[ 597
I would do the same if the first and the last operators was diffrent:
(323 ~ 5) ]]] ! 597
Only in the next step, I "thought" about [[, but it was inside brackets alreaady.
Hi,
Thanks you both for the help..
I thought I got it, but I don't...
Expression: 323 [[ 5 ]]] [[ (597)
Operators: [[(Infix, 1), ]]](Postfix, 18)
[323.0, 'infix [[', 5.0, 'postfix ]]]', 'infix [[', '(', 597.0, ')']
In your way:
( 323 [[ 5 ) ]]] [[ 597
My calculation steps:
323.0, 'infix [[', 5.0 = 4278.0
4278, 'postfix ]]]' = 2139.5
2139.5, 'infix [[', 597.0 = 2568756.5
Result: 2568756.5 should equal 7491177.0
:(
And I know that the operators must be "solveable", but you can see in my calculation steps that everything is also "solveable"...
Thank you for the help :)
Sorry but I don't get it.
10´´´*´(8)##115:
It has operators from both sides.
I have wrote that ## has higher priotity then ' - Understood.
How come you add these brackets?
In math, if you have this expression:
2-3^2
^ has the higher priotity, so you calculate 3^2 and then you continue.... You don't add ( ) around 2-3 ....
This will flip the priotities of all the operators .....
Thanks :) I still don't know what is wrong with my solution...
Are you still able to see my question when it is hidden...? :-/
This comment is hidden because it contains spoiler information about the solution
Loading more items...