Beta

Searching for Bulls

Description
Loading description...
Puzzles
Games
Permutations
  • Please sign in or sign up to leave a comment.
  • dolamroth Avatar

    Nice kata, thank you!

  • anter69 Avatar

    So how different is it from this kata? https://www.codewars.com/kata/58a848258a6909dd35000003

    • fatherof4 Avatar

      Thanks for the search. Same underlying concept however the linked one has you playing a game yourself via contstruction of an object. This one has you tracking a simulated game, so enough of a variation I think.

      Question marked resolved by fatherof4 5 years ago
  • Blind4Basics Avatar

    Hi,

    Your random tests are still totally useless... :o

    • fatherof4 Avatar

      That solution solves for the 3 hidden static tests, but there's 30 randomized tests after that that this would fail, right?

      Edit: Blind4Basics, apologies you're right. Was testing against itself... hard to fail that. Have corrected the code, now fails appropriately. Thanks for noting.

      Issue marked resolved by fatherof4 5 years ago
    • Blind4Basics Avatar

      no, it's valid, as you can see. And that's the point: you random tests never generate valid situations.

  • Unnamed Avatar
    Test.assert_equals(bc_solver([("1111", "3B0C"),
                                  ...
                                  ]), "1211")
    

    In the classic version the digits are unique; they aren't here, so the rules should be stated more clearly. I see 9 cows here: 3 1s match 2 1s each and 1 1 matches 3 1s.

    • fatherof4 Avatar

      Thanks - had overlooked the uniqueness description of the original game. I've amended the description to classify it as a variation and made the repetition of numbers more clear.

      Issue marked resolved by fatherof4 5 years ago
    • Unnamed Avatar

      So what about counting cows? "[C]orrect numbers but in incorrect places" is ambiguous. Depending on the rules, each 1 in one number the example above can match each 1 in the other number except where it's a bull.

  • ZED.CWT Avatar
    def bc_solver(game_turns):
    

    Do NOT put solutions in the complete test WITHOUT renaming it