Ad
  • Custom User Avatar

    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.

  • Custom User Avatar

    Maybe this is why my solution fails :-(
    I've passed the 1500x1500. How far am I?

  • Custom User Avatar

    Nice kata :)
    I think that some details are missing in the description -

    1. Are duplicates allowed? (yes)
    2. What about diagnols? (ignore)
  • Custom User Avatar

    Submitted by mistake :(

  • Custom User Avatar

    I really enjoy this kata! Thanks :)

  • Custom User Avatar

    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 :-)

  • Custom User Avatar

    OK. It took me 5 minutes to fix my solution according to this rules and it works now :) Thanks!

    • I don't really understand why did you add this rule... Each operator has its prec. and it is possible to choose between operators from diffrent types, like I did in the example I've sent.
    • Anyway, I believe that ay rule you will chose is fine - you wrote this kata and it ok to chose any rule which clear, but at the moment the description isn't clear enught IMO.
    • I first though this kata should be 2ky, but some rules you add to make it more simple (like this one) make it 3kyu.
      It was fun :) Thanks!
  • Custom User Avatar

    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

  • Custom User Avatar

    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.

  • Custom User Avatar

    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
    :(

  • Custom User Avatar

    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 :)

  • Custom User Avatar

    Sorry but I don't get it.

    1. Why did you choose : as the first step if it has the lowest priority?
    2. Let's focus on the 8:
      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 .....
  • Custom User Avatar

    Thanks :) I still don't know what is wrong with my solution...

  • Custom User Avatar

    Are you still able to see my question when it is hidden...? :-/

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Loading more items...