6 kyu
Travelling on a Grid
290 of 613mmalkavian
Loading description...
Puzzles
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.
Nice and enjoyable kata, compliments.
It is just plain math
Wait, if coordinate A is always higher than B, why y1 < y2 is true?
It means that the translation is wrong. Which language?
java
because coordinates are ascending from top to bottom and left to right; as is usual in programming. therefore for
A (x1 y1)
to be higher thanB (x2 y2)
, its row must be smaller than that ofB
:y1 < y2
.Ruby translation kumited with updated description -- please check and approve (note: author is inactive)
Approved
fixed
For some reason most of the solutions are invalidated. Could you please check why?
[update] nevermind, I found and fixed the problem
Haskell translation
Great Kata. I searched for 2 days the solution :)
This comment has been hidden.
You are right, I'm trying to modify the description with yours.
any tips or hints on how to tackle the problem?
Good Kata! Enjoyed it.
A few suggestions:
You should make it clear that the input text is always in valid format
I think cases where x1>=x2 or y1>=y2 should be added to the tests. I understand that you make it clear that there will be no input like this, but I personally think that such input should be allowed.
Also, perhaps introduce a harder version where board size is a parameter?
Cheers!
This comment has been hidden.
I think that in that case the result should simply be zero (as in the number zero, not null). You can't move from (2 2) to (1 1) using only moves to the right and down, so there are zero paths.
I generally agree with you, these kind of things (rounding, etc) bore me somewhat unless they are the goal of the Kata. But I feel that it is a natural part of the problem to ask "In how many ways can I get from (2 2) to (1 1)?"
However, it is your Kata, and this is definitely not a defect, just a suggestion, so it is up to you.
cool kata. was fun to play with. not sure what it has to do with chess? would it make sense to open it up to a larger board size?
well, you are right. I've used the idea of chessboard just to make the description shorter and more immediate without explaining grids. The board size can be made larger, but once you've found out how to solve the kata, it's the same anyway.