5 kyu

Sungka

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

    In sungka, when you're out of marbles in your row, you will keep on skipping turns until a marble reaches in one of your holes in your row.

    The reference solution in Python does not follow this rule, which can lead to unexpected failures in the random tests for solutions that do follow the rule.

    Here's one such input:

    moves:
      [4, 5, 7, 3, 2, 1, 7, 6, 2, 3, 3, 1, 6, 1, 3, 7, 3, 4, 7, 6, 6, 5, 7, 7, 5, 4, 7, 3, 7, 7, 1, 2, 6, 7, 2, 6, 6, 6, 4, 4, 4, 2, 7, 1, 2, 2, 4, 3, 6, 2, 2, 3, 2, 1, 1, 4, 5, 6, 4, 1, 1, 5, 4, 4, 7, 1, 5, 3, 5, 2, 2, 1, 4, 2, 2, 4, 6, 5, 1, 5, 1, 6, 6, 2, 3, 7, 3, 7, 3, 4, 7, 4, 2, 2, 4, 1]
    reference solution:
      [[0, 0, 0, 0, 0, 0, 0, 60], [0, 0, 2, 2, 1, 1, 3, 29], 1]
    actual solution:
      [[0, 0, 0, 0, 0, 0, 0, 63], [0, 0, 0, 0, 1, 2, 0, 32], 1]
    
    • dfhwze Avatar

      Maybe so, or maybe the description is not very clear about this part. From the example, I read this rule that a move should be ignored in such case, but the player stays the same.

      The 4th hole in player 2's row is empty, so what you will do is skip that move, but it's still player 2's turn, until it gets to a valid move.

    • tobeannouncd Avatar

      Following that rule, all remaining moves would be skipped if the player's row was empty, because there are no valid moves.

    • tenick Avatar

      You're right I should clarify that if the current player's whole row is empty, then it should only skip his turn but the move is not skipped. (of course if both players whole row is empty, then end the game)

      Also, if the current player's move points to an empty hole, but its whole row is not empty, then it will skip that move but not the players turn.

      I'll update the description and reference solution, thank you

    • tenick Avatar

      done

      Issue marked resolved by tenick 5 months ago
  • dfhwze Avatar

    I suggest to add these edge cases tests in sample/fixed tests:

    • move = [5, 5, 1, 3, 1, 4, 2, 7, 7, 2, 3, 4, 3, 2, 7, 2, 1, 5, 2, 2, 3, 2, 3, 6, 4, 3, 5, 5, 4, 3, 6, 4, 4, 4, 3, 2, 2, 2, 4, 5, 6, 3, 1, 5, 2, 6, 6, 5, 2, 7, 5, 7, 4, 5, 4, 1, 2, 5, 5, 4, 5, 3, 5, 2, 6, 4, 2, 4, 3, 4]
    • move = [5, 1, 6, 1, 7, 1, 2, 4, 4, 5, 3, 6, 6, 4, 5, 6, 7, 2, 3, 4, 5, 7, 1, 2, 7, 5, 3, 3, 7, 1, 1, 4, 6, 3, 2, 2, 6, 7, 1, 1, 2, 7, 7, 6, 5, 2, 5, 6]
    • move = [7, 3, 3, 2, 4, 1, 1, 4, 3, 7, 5, 1, 2, 5, 4, 7, 1, 6, 2, 7, 2, 3, 7]
  • dfhwze Avatar

    Should add simulation tag. If you're still considering developing a follow-up kata that involves actually playing Sungka against a bot, it would be advisable to modify the current kata's title to something more descriptive like "Sungka Simulation" to better reflect the potential future implementation and scope of the challenge.

  • dfhwze Avatar

    Requires an update of Python framework.

  • Voile Avatar

    This comment has been hidden.

  • tonylicoding Avatar

    How does - bookmarks or - collections happen? hence, -24 stars(bookmark) for this kata.

  • hobovsky Avatar

    Her: so, how old are you?

    Me: I am this old. I am this old

    • tenick Avatar

      Ooooohh yea I remember this game but I didn't know how to play it before lol @ialiyen Bantumi is basically Mancala for Nokia.

    • hobovsky Avatar

      I remember I managed to work out a strategy which was guaranteed to win against the phone, but I do not remember it now :( When reading the description of the kata I actually hoped it would be a bot fighting about some refernce solution with objective of winning the game. Kinda disappointed it's not, and I think it should be your idea for next kata :)

    • tenick Avatar

      Yeah you're right I think that's better. But you know there are some Katas that are related, like the 4x4 skycrapers kata then 7x7 skycrapers kata. So I'll probably make something like that.

  • RazNaot Avatar

    Lovely one, very well done!! Thanks for making it :-)

    • tenick Avatar

      Thank you so much man this is my very first Kata I very much appreciate your take on this one! If there's anything you find something to improve, maybe the description was too wordy, maybe the test cases are not enough, or you found something else please let me know! :)

    • RazNaot Avatar

      Nothing I can come up with... well written in all. You may have to wait for more people to finish so you'll get a better perspective. The thing with katas about games is that you have to explain in length many rules - could be deterring, but no choice for you... you have to explain. I hope many people know the game (or mancala), because it helps a lot. So I suggest that you add to the description a link to a real on-line game (like Unnamed's link / maybe something a bit more modern???) where people can play the game first.

    • tenick Avatar

      You're right man. I found a modern website for mancala game and will add it in my description, thanks!