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.
Thanks :-)
Hi, Thanks for your feedback. Fixed. I've added the import numpy as np line to the initial solution
Also, I'm going to unpublish this for the moment until I have random tests working. Was the description easy to understand?
Dont wait for others to import libs for your tests
Please don't link to kata edit page...
Hi,
I've published another Kata on extracting a closed contour from a Black and White image. I have code that generates images with random curves and contours, but I do not yet have any random tests in the Python Code wars testing framework, since I first wanted your comment on whether this Kata has any chance at all in being accepted. If you think this Kata has a decent chance of being accepted, then I will start generating random test cases using the codewars framework.
The kata is here https://www.codewars.com/kata/5ed6327fc66c2b001630fe37/python
Thanks and Best wishes
Note: I've unpublished this for the moment until I can add the random tests. Are you still able to see the Kata?
added
Please add the tag recursion as well since Recursion can be used to great advantage here.
Those who are looking particularly for recursion problems will find this one
Am I the only one confused by this? :-)
Maybe I'm over thinking this.
I feel what you really need to do is add extra information to number 4 as that is the source of confusion.
If the value of both die are the same and he lands on any square other than 100, then that player will have another go. However, if he lands on 100 with value of both die being the same, then the player wins and does not have to roll again.
Thanks :-)
Resolved
Updated Description
Hi @adrian.eyre
Here is a statement from the problem description
Return Player n Wins!. Where n is winning player that has landed on square 100 without any remainding moves left.
So, if he rolls (1,1) to get to 100, it means there is a remaining move left, no? If not, the problem statement is confusing
Hi @tumati
Why does it imply the player has a remaining move? If the player is on 98 and roles (1,1) then they would go to 99 then 100 and therefore win the game.
Sorry if Im not understanding the issue.
in one of the random tests, here is the output
Player 1 is on square 98, test passed
Player 2 is on square 85, test passed
Player 1 is on square 100 should equal, player 1 wins. ---> Here there is clearly is an error in the test case
I eventually passed all the test cases by modifying my code, but it goes against your instructions in the problem statement that a player wins only if he gets to 100 without having any moves left over
If player 1 was originally on 98, then the only way he can get to 100 is by rolling (1,1). Since (1,1) implies that he has a remaining move, player 1 does not win even though he is on 100.
Is it possible to write tests in a way that they accept answers within a particular range?
You could try to make the time step adaptive, i.e. ask the user to figure it out under the condition that output be within 1% of the correct answer.Obviously, you'd have to write the tests in a way that they accept answers within a particular range. Is it possible to do that?
Loading more items...