6 kyu
Atomic Chess
104brodiemark
Loading description...
Strings
Lists
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Some solutions mutate
position
and while that doesn't break the meaning or the tests, it does feel "wrong."Hi, very nice kata, love it :)
Please please please make a harder version (either normal chess or atomic chess or even both) (suggestions to make it harder below)\
Thanks for the comment. Much appreciated!
There are some kata similar to what you suggest. Check out these:
"Check and Mate?"
"Is the King in check ?"
"One line task: Is the King in check ?"
"Explain the Algebraic Chess Notation"
"Find the Final Position"
Enjoy!
Great kata of the chess series.
Thanks!
You're very welcome, this series is one of my favorites.
Hi,
The sample tests aren't using the test framework
Cheers
(edit:
numOftests
shoudln't be hardcoded, but computed from the tests data, btw)Done.
Hi @Blind4Basics,
Are there any more issues with my Java translation "Help the frogs reach the opposite side of the line"(https://www.codewars.com/kumite/63d426ddc65ba412541650a4?sel=63d426ddc65ba412541650a4)?
This comment has been hidden.
Hi Alex,
Can you give some examples of positions where your program doesn't pass the test? That would make it easier to provide assistance. Usually pasting a long piece of code is not so helpful.
Regards,
Mark
Hi, thanks for your attention. Results: Basic tests has all passed. Fixed tests Regular cases (22 of 22 Assertions) Corner cases (8 of 8 Assertions)
Random tests Random target sets of 9 squares are filled with random pieces and then a random capture into the target is generated. Positions are not necessarily legal chess positions. (3 of 4 Assertions) Random legal board positions are generated. A random move is made. Some are captures, some not. (32 of 33 Assertions)
Unexpected exception raised
Traceback (most recent call last):
File "/workspace/default/.venv/lib/python3.10/site-packages/codewars_test/test_framework.py", line 112, in wrapper func() File "/workspace/default/tests.py", line 557, in run_target_tests actual = make_atomic_move(copyOfBoard, move)
File "/workspace/default/solution.py", line 228, in make_atomic_move if position[K_Y_after-1][K_X_after+1] != "p" and position[K_Y_after-1][K_X_after+1] != "P": # Верх Право
IndexError: list index out of range
It looks like one of your indexes, either K_Y_after-1 or K_X_after+1, is either <0 or >7, so position is going out bounds. To help figure out why this might happen, let me suggest that you include with the solution the following:
In the very first line of your function, do
printBoard(position)
When a test fails you should see the actual position printed out, which should help diagnose the issue.
Thanks for help, i found out solution! -)
Well done!
If you like chess problems, there are quite a few, although many of them don't have "chess" in the title. Probably the easiest way to find them is to type chess in the search box and then go to the Collections link (next to Library in the middle of the page.) People have compiled different collections of their favorite chess kata.
What is
Element [8][1]
? The error messages are not user friendly and introduce unspecified array indices.Why not say Element 'e5' etc ..
Changed so that it is now "a1 should contain R not ." etc.
You can republish your kata now
There are only 8 squares surrounding the capture.
Changed "surrounding the capture" to "around and including the square where the capture takes place".