6 kyu
Check by Queen
319 of 626dukies_2000
Loading description...
Fundamentals
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.
Hi dukies_2000,
Are you interested in having this problem translated into other languages?
Regards,
brodiemark
python new test framework is required. updated in this fork
Approved by someone
Python:
In description:
while ONE of these 25 elements will be represented by a "q" (queen) and a "k" (king). Both will be represented in lower case
In tests, seems pretty invalid to me!!
Woah! I have no idea what happened here! I had just merged a Python translation. Although, I've never formally studied Python, is it possible that the code below is causing the problem when generating the random board?
It looks fine to me, but it's the only thing I can think of that would produce such a result.
2 problems here:
board = [['*']*5]*5
. VERY BAD: this way, the same list instance of length 5 is put 5 times in the board. That's why all the rows of the same column contain 5 kings or 5 queens. And sometimes, due to the first point, you end up with only kings in the board.Lots of things still to learn, for the translator, here... ;)
Sorry about that, i translated this kata the same week i learnt Python, About the problems
rand(0, 4)
four timesI have clarified this issue but i cant seem to Publish my changes, getting a
Error: python version python not supported
error, So i forked it, Please approve the fork Python translation fork @dukies_2000Fixed (without the new fork).
@kodejuice Thank you for clarifying the issue with the fork. @siebenschlaefer Many thanks for fixing the issue!
Nice kata, you could have made it N x N though... Anyway heres a Python translation
Thanks. It looks good to me, and yes, N x N would have been a nice extra. I am happy to merge this with my code. This kata is currently being used as an application to a course, so I'd like to keep it the way it is for the next couple of weeks. After that, I would be more than happy to merge it. Thank you :)
Application process is over. I have now merged your python translation to my kata : )
Could you have a look at the issue above please.
Approve the fork (Python translation fork), cant seem to edit my kumite....but i have clarified the issue
Approved some time ago
Input modification vulnerability in random tests fixed.
This solution is now invalid.
Wow, thanks for that! I had no idea that my random test could be vulnerable. Do you have any advice or know of any resources I could use to try and prevent this in the future?
Meanwhile, thanks for fixing the 'board9' issue for me, and for all the advice you gave me on my previous kata. I have now unpublished that previous 'incarnation' as advised ; )
Objects and arrays are mutable. If you pass them inside a function, the function can mutate them all it wants. And then if you reuse the same object for different purposes, unexpected things can happen.
So the safe way is to always pass a deep clone of the object.
Thank you so much :)
Example tests are missing
board9
.Fixed.