Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Ok, this was fun (as always a little bit sobering to see the better solutions..), though strangely, so few people attempt this one. I think it might be a good idea to give a little more introductory info on the game rules like:
"(Mega)Connect4 is played on a vertical, rectangular board. The players tokens drop in a column and stack on top of each other. The win condition is met when the token of the current move connects N-1 other tokens of the same kind in a vertical or horizontal line or a line parallel to the boards diagonals."
Kata could be made more user friendly by either:
For now it's a black box, and doesn't help users figuring out how much optimisation is required.
Not helpful at all. Even on a clean solution, no logs, we are not able to see how many tests there are, and of which sizes.
There is a room for performance improvement, but this kata is not about performance
interesting solution ;)
Thank you, found my mistake
first test: (pieces, result)
([[[0, 0, 1, 1, 0, 0], [0, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 0], [1, 1, 1, 1, 1, 1], [1, 0, 1, 0, 1, 1]], [[0, 1, 0, 0, 1, 1], [1, 1, 1, 1, 1, 1], [0, 1, 1, 1, 1, 0], [1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1], [0, 0, 1, 1, 0, 1]], [[0, 0, 1, 1, 0, 1], [1, 1, 1, 1, 1, 1], [0, 1, 1, 1, 1, 0], [1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1], [0, 0, 1, 1, 0, 0]], [[0, 0, 1, 1, 0, 0], [0, 1, 1, 1, 1, 0], [1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1], [0, 1, 1, 1, 1, 0], [0, 1, 0, 0, 1, 0]], [[0, 0, 1, 1, 0, 1], [1, 1, 1, 1, 1, 1], [0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 0], [1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 1, 1]], [[0, 0, 1, 1, 0, 0], [0, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 0], [1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1], [0, 1, 0, 0, 1, 0]]], [[[0, 0, 1, 1, 0, 1], [1, 1, 1, 1, 1, 1], [0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 0], [1, 1, 1, 1, 1, 1], [1, 1, 0, 0, 1, 1]], [[1, 0, 1, 1, 0, 0], [1, 1, 1, 1, 1, 1], [0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 0], [0, 0, 1, 1, 0, 0]], [[0, 0, 1, 1, 0, 0], [0, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 0], [1, 1, 1, 1, 1, 1], [1, 0, 1, 0, 1, 1]], [[0, 0, 1, 1, 0, 0], [0, 1, 1, 1, 1, 0], [1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1], [0, 1, 1, 1, 1, 0], [0, 1, 0, 0, 1, 0]], [[0, 1, 0, 1, 0, 0], [1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1], [0, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 0], [1, 1, 0, 0, 1, 1]], [[0, 0, 1, 1, 0, 0], [0, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 0], [1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1], [0, 1, 0, 0, 1, 0]]])
What is the solution for first fixed test in python? I can solve all random tests but, can't find solution for 1, 3 fixed tests.
:)
Arrgh! Even there, you sneaky bastard :)
Generally you're correct but there are specific limitations in this kata which prevent you from doing that
It's Java not JavaScript. Classname should start with uppercase and use camelcase.
@rwood112 wait so is rollback(1) trivial? I was under the assumption that the argument for rollback denoted the number of moves to undo.
Done
.
Loading more items...