Ad
  • Custom User Avatar

    Pardon my lack of knowledge, but what do you mean by 'mutating input'? 'Cause I'm facing the same issue as you.

  • Custom User Avatar

    ok but, again, don't consider your approach as a solution (that is, if you kept it). If you keep that habit of mutating the input, you'll trigger hatred from your colleagues to be because you'll create bugs hard to track! ;)

  • Default User Avatar

    looks like I did mutate the input, it is working now, not getting the issues anymore with the draw tests, thanks!

  • Custom User Avatar

    done. You shouldn't have problems anymore. But Don't mutate the inputs!

  • Custom User Avatar

    I can confirm that the expected results should be the following:

    Red
    Red  <<< warning
    Yellow
    Red
    

    Tho, what's weird is that, when I run my solution (which expects those output), I never get any fail in the random tests. So... Are you absolutely sure you read the assertion messages correctly?

    Investigating further: the reference solution is expecting the same results. You messed something in your logs. Closing.

    (note: ooooh... Lemme guess: you mutate the input array, right? Do NEVER mutate the input. When you do so, nothing can be guaranteed anymore and you're just facing it right now. I'll update the test suite)

  • Default User Avatar

    anyone else having problems with the ruby random tests? I manually tested a couple I got wrong but even drawing it out on a grid, it should have passed. Issues seem to be with the Draw tests.

    ["B_Red", "D_Yellow", "D_Red", "A_Yellow", "F_Red", "C_Yellow", "F_Red", "A_Yellow", "E_Red", "F_Yellow", "C_Red", "F_Yellow", "C_Red", "E_Yellow", "E_Red", "A_Yellow", "E_Red", "B_Yellow", "B_Red", "C_Yellow", "D_Red", "E_Yellow", "B_Red", "E_Yellow"]

    -> expected draw, but the winning move is horizontal red

    ["D_Red", "F_Yellow", "A_Red", "G_Yellow", "B_Red", "D_Yellow", "C_Red", "D_Yellow", "A_Red", "B_Yellow", "E_Red", "D_Yellow", "C_Red", "G_Yellow", "B_Red", "D_Yellow", "G_Red", "B_Yellow", "F_Red", "A_Yellow", "G_Red", "E_Yellow", "F_Red", "A_Yellow", "C_Red", "F_Yellow", "F_Red", "D_Yellow"]
    #-> expected draw, yellow actually wins bottom horizontal

    ["F_Red", "D_Yellow", "G_Red", "A_Yellow", "D_Red", "C_Yellow", "F_Red", "B_Yellow", "G_Red", "A_Yellow", "D_Red", "E_Yellow", "D_Red", "A_Yellow", "C_Red", "A_Yellow", "G_Red", "E_Yellow", "A_Red", "D_Yellow", "D_Red"]
    #-> expected draw, yellow actually wins bottom horizontal

    ["D_Red", "F_Yellow", "B_Red", "C_Yellow", "D_Red", "C_Yellow", "D_Red", "E_Yellow", "G_Red", "B_Yellow", "G_Red", "C_Yellow", "D_Red", "E_Yellow", "F_Red", "F_Yellow", "B_Red", "D_Yellow", "A_Red", "B_Yellow", "D_Red"]
    #-> expected draw, red actually wins vertically in D