Retired

Bresenham Line Drawing (retired)

Description
Loading description...
Graphics
Algorithms
  • Please sign in or sign up to leave a comment.
  • ZED.CWT Avatar

    This comment has been hidden.

  • user9644768 Avatar
    • CopperFr Avatar

      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...

    • user9644768 Avatar

      Yes but mine is different because you plot the pixels on the virtual screen and see the result.

      A plain simple forEach() addition doesn't add much triviality.(open to discuss)

      The duplicate is very old and still in beta...

      But the satisfaction rating (100 % of 5) is enough to take it out of beta.

    • CopperFr Avatar

      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)

    • user9644768 Avatar

      Still in beta after 6 years ok

      Out of beta now.

      You're not really doing Bresenham in your solution because you use * / float

      I ain't failing any of your test.

    • CopperFr Avatar

      Tests updated. Code checks tests fails now

    • user9644768 Avatar

      It seems you've not properly forbided them.

    • CopperFr Avatar

      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.

  • Avanta Avatar

    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:

    ⬜⬛⬛   and   ⬜⬜⬛
    ⬛⬜⬜         ⬛⬛⬜
    

    Both of these should be accepted.

    • CopperFr Avatar

      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

    • Avanta Avatar

      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.

      Issue marked resolved by Avanta 5 years ago
  • FArekkusu Avatar

    The task is not explained at all.