Open cd155 opened 1 year ago
I made a better version for the fill-up painting function. @balacij
Looks much better! :smile:
Are you able to do it row-wise instead of point-wise out of curiosity?
Looks much better! smile
Are you able to do it row-wise instead of point-wise out of curiosity?
@balacij I actually not sure how to this question row-wise. The current way is to find all the coordinates of possible points that need to be painted. Once find all of them, then paint them accordingly.
The ideology of row-wise seems very interesting. Thanks for pointing it out. It's doable, and I will keep you in the post.
It was just a thought on how an algorithm could be done if you know the ranges of the "insides" of the shape by length along the horizontal axis. I hope it works :smile:
This is the paint-fill function. @balacij
https://github.com/cd155/algorithm-design-with-haskell/blob/b3f39e54e38a4f067fb10c3ced4c1ef04ada3432/src/Recursion.hs#L372-L499
Let me know what you think. I think there should be a way to simplify the
findAreaOnDir
method. It looks very cumbersome.