17

Should be easy enough to find the mistake...

Comments
  • 0
    is this manually generated??
  • 2
    @bigworld12 I’m hoping not, but it’s the spec we’re given to work from.
  • 3
    @joycestick i would fucking suicide rather than work on a cluster-fuck of variables and round brackets like this
  • 7
    I found the mistake.
    XML
  • 4
    Dude,
    ...
    You're fucked.
  • 4
    Maths teachers be like "solve for $h"
  • 0
    P.E.B.C.A.K.
  • 1
    My 2 cents:

    Write a script that takes the string and sets it on fire.

    My 2 useful cents:
    Make the script check each character.

    If it finds "(" or "+" or "," it should add the character to the current string as usual an then add the current string to an array and start a new empty one.

    If it finds ")" it should first add the current string to the array and start the new one with ")"

    You can then indent it by iterating through your array and adding as many "\t" characters to the beginning of each string as your indentation counter.

    A string ending in "(" adds 1 to the counter.
    A string starting with ")" subtracts 1 from the counter.

    Output the result of stringArray.join ("\n") operation to a file.

    This should make your life a lot easier.
  • 1
    Don’t pull my eyes out of my head and beat them to a pulp so early in the morning 😭
  • 0
    Wolfram alpha might help..
Add Comment