5 kyu

Tic-Tac-Toe (3D)

55 of 363dinglemouse
Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • oqo0 Avatar

    Description says: Four of the same symbols in a row wins Why no information that 4 symbols in a diagonal is also a win?

  • seriousGame Avatar

    I haven't seen the bug for 3 days!

  • goldenratio161 Avatar

    python fixed tests are lists within a list, but random tests are tuples within a list. took me a bunch of debugging to figure that out.

  • Pythonary Avatar

    HI EVERYONE, Im new here and I've been learning C for like 3 weeks. and I really wanna know how you guys solved this kata. I hope you give me a premission to see some ideas for soultions :) thank u.

  • MobulaKuhlii Avatar

    This is apparently a board on an X winning move (left-0th layer):

    ----------- 37
    X O _ _ | X _ _ _ | O O O X | X _ O X
    _ X _ _ | _ _ _ _ | X _ _ _ | X O X O
    _ O X O | O X O O | _ O O O | O _ X X
    _ _ X _ | _ _ _ O | O O X X | _ X X _
    

    how? I can only see a diagonal but it's split 3-1, is that valid?

  • Voile Avatar

    There is using namespace std; in C++ Preloaded section which should be removed. See: https://github.com/codewars/content-issues/wiki/List-of-Cpp-Kata-to-Update

  • ejini战神 Avatar

    Python new test framework should be used with 3.8 enabled

  • G_kuldeep Avatar

    can you tell me how X win in this situation?

    ['X', 'O', ' ', 'O']
    [' ', 'X', 'O', ' ']
    ['X', 'O', 'X', 'O']
    [' ', 'O', 'X', 'O']
    -------------------
    ['O', 'O', ' ', ' ']
    [' ', 'O', ' ', ' ']
    ['X', ' ', 'X', 'X']
    [' ', ' ', 'O', 'O']
    -------------------
    ['O', ' ', 'O', ' ']
    [' ', ' ', 'X', 'X']
    [' ', ' ', ' ', 'X']
    ['O', 'X', 'X', 'O']
    -------------------
    [' ', 'X', 'X', 'X']
    [' ', ' ', ' ', ' ']
    [' ', ' ', ' ', ' ']
    [' ', ' ', ' ', ' ']
    -------------------
    
  • flaco Avatar

    with numpy i had a working solution in no time. then i spend one hour to make it fast enough haha awesome kata

  • JohanWiltink Avatar

    Haskell translation

    ( This has 100 random tests. Was there any particular reason JS has 1000? )

  • MP7373 Avatar

    It doesn't clarify 3 in a row is the win condition anywhere in the instructions. It should say that just to be clear. With the board being 4x4x4 people could write an entire 4 in a row solution then run the tests and have to do a bunch of work to fix it.

  • KataSideKick Avatar

    C# Translation added.Please review and approve~

  • frefer Avatar

    i am a newbie, i need dat print log on random test, can u please make it happen

  • clcraig Avatar

    @dinglemouse, JavaScript translation ready.

  • clcraig Avatar

    @dinglemouse, C++ translation ready.

  • dinglemouse Avatar

    Thanks @ZED for approving

  • Jomopipi Avatar

    I like it! thanks!

  • StefanPochmann Avatar

    The sample test "xWins" looks invalid. Player O makes a move after the game is already over.

  • Blind4Basics Avatar
  • Blind4Basics Avatar

    Hi,

    It seems you forgot some directions in your solution... :wink:

    [1, 0, 3] ; O
    [3, 2, 2] ; X
    [0, 1, 1] ; O
    [0, 3, 3] ; X
    [0, 2, 1] ; O
    [1, 3, 3] ; X
    [3, 3, 2] ; O
    [3, 1, 0] ; X
    [0, 1, 2] ; O
    [2, 1, 1] ; X
    [1, 3, 0] ; O
    [0, 0, 2] ; X
    [3, 0, 1] ; O
    [2, 2, 1] ; X
    [0, 0, 1] ; O
    [2, 3, 1] ; X
    [2, 0, 1] ; O
    [1, 1, 2] ; X
    [3, 3, 1] ; O
    [0, 1, 0] ; X
    [3, 1, 3] ; O
    [1, 2, 0] ; X
    [0, 3, 2] ; O
    [3, 0, 3] ; X
    [2, 1, 3] ; O
    [3, 0, 0] ; X
    [3, 2, 0] ; O
    [3, 1, 2] ; X
    [2, 2, 0] ; O
    [1, 2, 1] ; X
    [1, 1, 3] ; O
    [2, 3, 0] ; X
    [2, 0, 0] ; O
    [1, 3, 1] ; X
    [2, 3, 3] ; O
    [1, 0, 2] ; X
    [2, 1, 2] ; O
    [2, 2, 2] ; X
    [1, 2, 3] ; O
    [3, 2, 3] ; X
    [1, 3, 2] ; O
    [0, 1, 3] ; X
    
    found:
    (0,1,3) -> X
    (1,1,2) -> X
    (2,1,1) -> X
    (3,1,0) -> X
    Random test #36. EXPECTED O wins after 45 moves
    expected:<[O wins after 45] moves> but was:<[X wins after 42] moves>
    
  • dinglemouse Avatar

    ADVERT

    Please say it isn't true. Surely we don't need another Tic-Tac-Toe Kata!