7 kyu
Talisman Board Game Combat System Checker
40 of 413Mackay
Loading description...
Games
Algorithms
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.
python new test framework is required. updated in this fork
Approved
I suggest fixing a few sentences in the Instructions for clarity. My suggested versions are below:
-If the player has at least 6 more power than the enemy (including modifiers), the player automatically wins, as the enemy's combat score couldn't possibly exceed the player's.
-If the player has less power than the enemy (including modifiers), the player can only win if the enemy rolls low enough for the player to have a chance. In this instance, the method should return a range equal to the ENEMY’s dice rolls which would give the player a chance to win.
in description
Player 1 rolls a '
should bePlayer 1 rolls a 4
Fixed
The
"(1..0)"
test should be a sample test, not only fixed. Moreover, it's nowhere said that ending up in a tie (which leads to this outcome) means auto-lose.EDIT:
In the case of a tie combat ends with neither player losing a life.
I wonder what's wrong with this statement...Mmmmmh... I might have not choose well, yes.
What do you think about what could be the correct output, then?
Check my reply to your previous comment.
Maybe there should be a test case for "Tie at best" if the difference between powers is 5
Yeah, that's what I'm thinking about: introducing a new case:
Hope for a tie!
.@FArekkusu: the
(1..0)
answer didn't make any sense, so I agree you disagree with my (poor, yes) choice, but you cannot agree with the original solution! ;)I'll make some update in the next few minutes.
changes made:
"Pray for a tie!"
we good?
Ok, now this make sense.
Yet, I'm questioning myself - is this is actually a
6 kyu
kata? The whole solution is a mereif
statement, it's almost the same as those8 kyu
"determine which mark the student got if A >= 90..." with the only difference is that this one is a little harder (more like7 kyu
). What do you think?that could be 7, yes. I opted for 6 because that was the average and the choice of the author. But I can change it, yes.
I think it's incorrect to output (1..0) when the difference between the player and the enemy is -5. It's meaningless and there's no way the player can win in this case.
Agreed. I updated the 3 versions (...and invalidated all the previous solutions doing so...)
Maybe you agree with it, but I do not. For some reason the author mentioned (though didn't test) that ending up in a tie is neither a win nor a lose. Having
N
points and rolling6
when the opponent hasN+5
and rolls1
, you end up in aN + 6 = N+5 + 1
situation. The only way to truly resolve this issue is either never generate such situations or rewrite the kata so the users should handleopponent - player == 5
situation separately.In the kata description the function to be implemented is called
get_requirements
, yet in the code it is calledget_required
.The only issue I had was that the kata started with the function defined as
getRequirements
, but it actually needs to begetRequired
.Translated into both Python and JS, if you want to approve it.
Once you are done (provided my work is ok with you, of course!), tell me if you may be interested to adding random tests to the Ruby version too and remember me to fix the function in the description examples (
get_required
, notget_requirements
, but if you change it now, approving the translation may become troublesome).Oh, and in any case, thanks for the kata and great work explaining what you expect as an output in every detail :)
This comment has been hidden.
It's strange to me that the expected range is of the player's possible rolls when the player has a higher initial score, but that it's of the opponent's possible rolls otherwise. If the opponent's initial score is, say, three points higher than the player's score, wouldn't it make more sense to have the expected result be (4..6) to reflect the player's rolls that could result in not losing, so that a returned range always refers to the same player?
Yeah, this part does not make any logical sense.