Ad
  • Default User Avatar
  • Custom User Avatar

    Ruby is so good! =)

  • Default User Avatar

    Aah that's clever. I have one question though:

    So if a condition is not met the first time a ternary statement is
    called, and there's recurssion on the false side, would it ever go
    through the true side again? (i.e. would it just keep going back to
    the recursive point, which is the false side in this case?).

  • Custom User Avatar

    This is simple and elegant and does what it says on the tin. A+.

  • Default User Avatar

    Oh...ok. LOL

  • Custom User Avatar

    In short: nobody cares about your opinion.

    In long: There are a dozen reasons why someone considers something best practice, and the classical UUN (aka "unreadable, unmaintainable and not for production") argument is the worst excuse to object to other's reasons why they think a solution is "best practice".

    And guess what? Most good golfers are also very good at learning, re-iterating, and writing clean, concise code with their language too because golfing actually takes effort. Now if you're really a "newcomer", I hope you don't hold your attitude like this for the rest of your life, because that means you aren't even learning, and it'd be the real terrible thing. I wouldn't even need to take a guess who is more capable.

  • Custom User Avatar

    Comment deleted because it might have upset someone

    TLDR: Agreed with Smudge that no one should be fired just because they code in this way, but expressed agreement with the sentiment that I don't find it great for readability. YMMV. It was just my opinion.

  • Default User Avatar

    Nice and beautiful

  • Custom User Avatar

    It's a bad thing we can't check that coincidence

    Nope, that’s absolutely not how it works.

    The burden of proof lies entirely with the person who makes the allegations, i. e. you.

    So it’s not “a bad thing we can’t check”. The only thing that may be unfortunate here is the fact that you’ve decided to jump to conclusions instead of substantiating your claims.

  • Custom User Avatar

    "So you’re saying the solution is so easy that it constitutes cheating?"

    If that's the case it shouldn't have to be in this category

    "So you’re saying the solution is so difficult that > 100 people can’t possibly have come up with it independently without using Google?"

    It's a bad thing we can't check that coincidence

  • Custom User Avatar

    but the idea of having such problem is to actually code the solution.

    So you’re saying the solution is so easy that it constitutes cheating?

    Try Googling Rot13 Ruby you'll find exactly the same.

    So you’re saying the solution is so difficult that > 100 people can’t possibly have come up with it independently without using Google?

  • Custom User Avatar

    Probably the author is not aware of such method in Ruby, but the author mentioned that using 'encode' in python was considered cheating(for instance). If you would have done that in python it would be as easy as writing string.encode('rot13'). I know Ruby has bunch of methods and the language itself is quite simple to use but the idea of having such problem is to actually code the solution.

    The reason I accuse others for using the same solution is just because you can find it in StackOverflow or any other website. Try Googling Rot13 Ruby you'll find exactly the same.

  • Custom User Avatar

    If you think this is cheating, go code in C. This is Ruby, and it's done like this in Ruby.

    Also, if the kata author have not actually disabled the relevant built-ins, it's considered not disabled no matter how the kata author says otherwise. As the old saying goes, show, not tell.

  • Custom User Avatar

    This is obviously, cheating. You're not suppossed to use ruby's methods that already solve the problem, you're supposed to code your own solution by thinking, not by copying and pasting what you first find in Google.

  • Custom User Avatar

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

  • Loading more items...