Retired
Bresenham Line Drawing (retired)
Loading description...
Graphics
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.
This comment has been hidden.
Thanks I think the issue is fixed now
Duplicate
Yes but mine is different because you plot the pixels on the virtual screen and see the result.
The duplicate is very old and still in beta...
A plain simple
forEach()
addition doesn't add much triviality.(open to discuss)But the satisfaction rating (100 % of 5) is enough to take it out of beta.
Still in beta after 6 years ok
You're not really doing Bresenham in your solution because you use * / float
Perhaps i should add some advice and some check for that (using only + - integer bit shifting)
Out of beta now.
I ain't failing any of your test.
Tests updated. Code checks tests fails now
It seems you've not properly forbided them.
eval was not desactivated because it's not really interessing here. It's not like in some kata where the goal is to eval arithmetic expression.
There are many cases with multiple possible solutions, but only one is accepted.
For example, for a line (0, 1) to (2, 0), there are two solutions:
Both of these should be accepted.
You're right but with Bresenham Line Algorithm you should have the second one if you draw from 0,1 to 2,0 and the first one if you draw from 2,0 to 0,1.
I've changed title of kata to indicate that Bresenham algorithm should be used and order matter because not so easy with random test to have multiple solutions...
Thanks for feed back
Ok, so it seems like my implementation just did everything backwards.
I'm not really sure what to rank it though, because I pretty much just used the pseudocode from Wikipedia. It kinda becomes less of a 'solve the problem' task, and more of just a 'implement the algorithm' task, though.
The task is not explained at all.
The task is to draw the line on screen using color. Perhaps I should precise bresenham...
Yes, you should.