6 kyu

Tic-Tac-Toe-like table Generator

1,531 of 2,260GiacomoSorbi
Description
Loading description...
ASCII Art
Fundamentals
  • Please sign in or sign up to leave a comment.
  • jinks908 Avatar

    I hope I'm not overthinking, but I don't understand how we will know the correct number of rows. Are all of the inputs going to be nx2 rectangles? If so, I feel like that should be stated. Instead, all that is stated is that the "length of the array will always be a multiple of the width." But what if we are given an array of length 12? Will that be a 6x2, 2x6, 4x3, or 3x4 board? It says we are expanding beyond 3x3 squares and "accepting" rectangles of "big sizes." But without knowing the dimensions, there could be ambiguous solutions. Even with the example of a 5x2 board, what's to say it couldn't have been a 2x10 board instead? All of the conditions will still have been met.

  • PetitLu117 Avatar

    js fork enabling node 18 powered by katafix 🤖

    • use mocha/chai
    • use lodash
    • provided inputs on failure
    • custom error message for increased readability
  • CD777XC Avatar

    This comment has been hidden.

  • Maxsonin Avatar

    That was really hard for me... But i made it!

  • ejini战神 Avatar
    • Node 12 should be enabled (Refer this and this for more info)

    • Python new test framework should be used (Refer this & this for more detail)

    • Ruby 3.0 should be enabled (Refer this & this for more detail)

  • FArekkusu Avatar

    C++ 17 should be enabled.

  • De-Su Avatar

    This comment has been hidden.

  • KataSideKick Avatar

    C# Translation added.Please review and approve~

  • RDCLder Avatar

    I loved this kata. It's a really clever way of making sure you understand the fundamentals. I first figured out the logic needed to get the results using print on an IDE and then realized I needed actually return an output since this was a function. Luckily strings are easy to manipulate with a simple += so I didn't have to change the structure of the code.

  • clcraig Avatar
  • ZED.CWT Avatar

    as the array/list/vector lenght is always going to be a multiple of the width.

    Ruby

     Testing for ["X", " ", "5", "2", "X", "X", "O", "O", "2", " ", " ", "O", " ", "1", "2", "O", "1", "2", "X", "1", "O", "5", "O", "5", "X"] and 3
    It should work for random inputs too -  Expected:
    " X |   | 5 \n-----------\n 2 | X | X \n-----------\n O | O | 2 \n-----------\n   |   | O \n-----------\n   | 1 | 2 \n-----------\n O | 1 | 2 \n-----------\n X | 1 | O \n-----------\n 5 | O | 5 \n-----------\n X |",
    instead got:
    " X |   | 5 \n-----------\n 2 | X | X \n-----------\n O | O | 2 \n-----------\n   |   | O \n-----------\n   | 1 | 2 \n-----------\n O | 1 | 2 \n-----------\n X | 1 | O \n-----------\n 5 | O | 5 \n-----------\n X "