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.
8 ♛ ♚
7
6
5
4 ♙ ♛
3 ♙
2 ♙ ♙ ♙
1 ♕ ♔ ♗ ♘ ♖
[{'y': 4, 'owner': 0, 'piece': 'pawn', 'x': 6}, {'y': 5, 'owner': 0, 'piece': 'pawn', 'x': 5}, {'y': 6, 'owner': 0, 'piece': 'pawn', 'x': 3}, {'y': 6, 'owner': 0, 'piece': 'pawn', 'x': 4}, {'y': 6, 'owner': 0, 'piece': 'pawn', 'x': 7}, {'y': 7, 'owner': 0, 'piece': 'queen', 'x': 3}, {'y': 7, 'owner': 0, 'piece': 'king', 'x': 4}, {'y': 7, 'owner': 0, 'piece': 'bishop', 'x': 5}, {'y': 7, 'owner': 0, 'piece': 'knight', 'x': 6}, {'y': 7, 'owner': 0, 'piece': 'rook', 'x': 7}, {'prevX': 3, 'y': 4, 'piece': 'queen', 'x': 7, 'owner': 1, 'prevY': 0}, {'y': 0, 'owner': 1, 'piece': 'king', 'x': 4}] 1
A B C D E F G H
8 ♛ ♚
7
6
5
4 ♙ ♛
3 ♙
2 ♙ ♙ ♙
1 ♕ ♔ ♗ ♘ ♖
How is it 1's turn if 1's queen was just moved (presence of prevX and prevY)??The test just above this one makes more sense as it is almost the same test except it is 0's turn but in this test the placement is exactly same except it is 1's turn which is not logical because 1's queen was just moved.Plus white king is being checked in it but it shows that it is black's turn which is an impossible situation.
In the php sample tests, testQueen() has text "Bishop threatens king!", should update to "Queen threatens king!"
Aaaaaaand I have accidentally solved the kata by hardcoding two tests :( Damn, this kata really needs random tests, otherwise it's just easy points. I am aware that creating "real" random setup for various scenarios won't be easy, but maybe just some kind of quasi-randomization, like:
would ensure enough variety to make hardcoding infeasible?
Random tests? ;-)
Wow, this is definately harder than I thought it would be. Could you add some test cases for basic checks where some piece blocks the check?