Ad
  • Custom User Avatar

    ok, lots of problems here...

    You may not...

    • if you want the user to do the actual task, it's up to you to force him to do so. Meaning you HAVE to check that he doesn't use those things you don't want him to use. And that will be a real hassle... (generally done by checking the content of txt file of the user's code)

    • the description doesn't state what chars we are supposed to balance. It should (if it is, I missed it, then that implies that you didn't put the information at the right place x) )

    • about your test suite, keep "DRY" in mind => use loops, and absoilutely NOT copy/paste. Looking at your code, you should have one single random test method with 2 imbricated loops and only 2-3 additionnal lines.

    • you need to constrain your random generator so that it can feed the function with valid inputs too.

    • last but not least...:

    You're currently trying to do 2 completely different things at the same time. That's not a good idea. Better to do one single thing correctly than to do several but all "badly".

    The supposed task could be interesting (if you can achieve the enforcment of the restrictions before ending crazy), but the actual task, considering the absence of restriction is just... well... boring, and a duplicate of many other katas.

    What could be more interesting? -> give a complete description of the contract of your stack equivalent object, ask to desing it and test the functionnalities on your side, using the object itself. Tho, that would need a bullet proof (almost) restriction wall. Hard to achieve, I guess.

  • Custom User Avatar
    • the sample solution is missing its static keyword
    • all your random tests seems to always expecte false. Meaning they are currently useless.... ;p