Ad
  • Default User Avatar

    the pattern that you only needed to do two sides, this is the most impressive solution I've seen

  • Default User Avatar

    this dude charges by the line...

  • Default User Avatar

    Curious about stats on my profile... it says the highest Kata I've trained is 4, but on my list of kata there's clearly a 1 sitting in the list. Bug?

  • Default User Avatar

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

  • Default User Avatar

    many thanks trevdoz, indeed I needed to use a sledge hammer rather than a scalpel to define the words

  • Default User Avatar

    nice, makes sense. coding for undescribed requirements, sexy :)

  • Default User Avatar

    random tests on this are failing on me with Incorrect frequencies expected:<[29, 27, 18]> but was:<[27, 29, 14]>

    ...output is completely opaque as to what input was being tested and what it's even expecting. all the regular tests pass.

  • Default User Avatar

    In JS at least, the test cases completely ignore "the wheel"; the straight from ace to 5.

    These tests should pass:

        it("wheel beats high card king kicker", function() { assert(Result.win, "AS 2H 3D 4S 5S", "KH AD 4C 5H 9D");});
        it("wheel beats pair", function() { assert(Result.win, "AS 2H 3D 4S 5S", "2H 2D 8C 4D 5H");});
        it("wheel beats two pair", function() { assert(Result.win, "AS 2H 3D 4S 5S", "2H 2D 9C 9D 5H");});
        it("wheel beats trips", function() { assert(Result.win, "AS 2H 3D 4S 5S", "2H 2D 2C 4D 5H");});
    

    Almost all solutions are not looking for it. Without this check, this straight loses to even a high card (ace and anything over a 5), a basic pair, everything. Example, A2345 should soundly beat A3456 (busted straight) and everything up to trips, without the check it loses to most things.

    ...even the solutions marked "best practice" don't do it, which is quite funny really. "Best practice" on this site, really doesn't mean what people thinks it means :)

  • Default User Avatar

    the clever votes are fine, but people voting "best practice" on this site either aren't looking at the other solutions or not much of an idea about computing overhead...

    this solution has n² compute time and memory; every position re-runs the array count, and the counting done by making new arrays and the call stack.
    whereas managing counts in a dictionary is n.

    I mean no ill to the author, it's nice to look at as a piece of code, a cool alternative, I'm fine with it being marked as clever, I really am.

  • Default User Avatar

    cross character, nice. you might like to use the french accented 'í' instead of an i... anyone maintaining the code will go insane ;)

  • Default User Avatar

    I think people get too worked up over the 'Best Practices' button... dude was clearly golfing, and golfing is amusing and he did well. if he wants to golf, let him golf :)