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.
rotate
would have been better thanrev
, oh wellFor fuller explanation see my other solution https://www.codewars.com/kata/reviews/5a291688dd12a68916000b8e/groups/5fb33e0ccb4f8800012e44a6
What is this magic
Can you explain how this works?
Whoops, no need to remove initial negative numbers so that first line is irrelevant. That's left over from my earlier attempts.
Using TDD (coding best practice) would lead you to the answer almost straight away. What other kata promotes test driven development so effectively?
This comment is hidden because it contains spoiler information about the solution
(sorry, just testing)
Also you could just
Aren't we all? It never would have occured to me that I could alter the table. :)
I'm just learning, thanks!
Fearless! 😀
If I could work out how to edit this, I would change the checkFour description to be slightly clearer:
This function takes a grid as an array of arrays that is filling with 0s (player 1) and 1s (player 2).
It scans columns and rows for potential connect 4s, where the sum of the range will be either 0 or 4.
For example, connect 4 is only possible at co-ordinates [2,2] to [2,5] if column C has length 6.
You magician
Absolutely brilliant! Clever and clear.
👉😎👉
Loading more items...