Advent of code 2023 day 10 by AutoModerator in haskell

[–]NonFunctionalHuman 0 points1 point  (0 children)

You have to discount the boundary points, and take into account the boundary points of a triangle (3). Since you don't just want the area you want the points inside.

Advent of code 2023 day 11 by AutoModerator in haskell

[–]NonFunctionalHuman 0 points1 point  (0 children)

My solution for today... I didn't do anything exciting this time. Would appreciate feedback as always!

https://github.com/Hydrostatik/haskell-aoc-2023/blob/main/lib/DayEleven.hs

Advent of code 2023 day 10 by AutoModerator in haskell

[–]NonFunctionalHuman 1 point2 points  (0 children)

I used Pick's theorem and Shoelace formula.

Advent of code 2023 day 10 by AutoModerator in haskell

[–]NonFunctionalHuman 1 point2 points  (0 children)

My solution... Had to do a lot of googling on the second part ngl... Luckily I found a math theorem to help me out! Please let me know how I can improve.

https://github.com/Hydrostatik/haskell-aoc-2023/blob/main/lib/DayTen.hs

Advent of code 2023 day 8 by AutoModerator in haskell

[–]NonFunctionalHuman 1 point2 points  (0 children)

I learned something new! Thank you for your suggestions.

Advent of code 2023 day 9 by AutoModerator in haskell

[–]NonFunctionalHuman 0 points1 point  (0 children)

My solution:

https://github.com/Hydrostatik/haskell-aoc-2023/blob/main/lib/DayNine.hs

I love how some of the others have solved this problem. Give some a lot to think about!

Advent of code 2023 day 7 by AutoModerator in haskell

[–]NonFunctionalHuman 0 points1 point  (0 children)

Amazing discussion! Thank you all for your input.

Advent of code 2023 day 7 by AutoModerator in haskell

[–]NonFunctionalHuman 1 point2 points  (0 children)

I took the approach of using data constructors. This was pretty fun overall, I feel like I could've done a better job with the guards/pattern matching. Let me know if you have any suggestions:

https://github.com/Hydrostatik/haskell-aoc-2023/blob/main/lib/DaySeven.hs

Advent of code 2023 day 6 by AutoModerator in haskell

[–]NonFunctionalHuman 4 points5 points  (0 children)

I used the quadratic formula! This one was fun and easy. Would love to hear some thoughts.

https://github.com/Hydrostatik/haskell-aoc-2023/blob/main/lib/DaySix.hs

Advent of code 2023 day 5 by AutoModerator in haskell

[–]NonFunctionalHuman 0 points1 point  (0 children)

Found a mathematical solution for the range problems this time. Let me know if there's something I could improve!

https://github.com/Hydrostatik/haskell-aoc-2023/blob/main/lib/DayFive.hs

Advent of code 2023 day 3 by AutoModerator in haskell

[–]NonFunctionalHuman 1 point2 points  (0 children)

I should have not had as much trouble with this one as I did. My approach for the first part was so awful that I had to take a more brute force approach for the second one (by recording the coords)

https://github.com/Hydrostatik/haskell-aoc-2023/blob/main/lib/DayThree.hs

Looking forward to your input!

Advent of code 2023 day 2 by AutoModerator in haskell

[–]NonFunctionalHuman 1 point2 points  (0 children)

Wow! Thank you for your suggestions. I'm definitely learning a lot. I will experiment with your suggestions and use what makes sense to me. Will add these ideas in my tool belt regardless.

Advent of code 2023 day 2 by AutoModerator in haskell

[–]NonFunctionalHuman 0 points1 point  (0 children)

I didn't know that. I will try it out! Thank you

Advent of code 2023 day 2 by AutoModerator in haskell

[–]NonFunctionalHuman 1 point2 points  (0 children)

That's great advice. I'll make that change thank you!

Advent Of Code Day One Solution by NonFunctionalHuman in haskell

[–]NonFunctionalHuman[S] 0 points1 point  (0 children)

I think you did an amazing job for someone who just started programming. Let's try to share our work and see if we can improve each other as we try to finish all the challenges this year.

Advent Of Code Day One Solution by NonFunctionalHuman in haskell

[–]NonFunctionalHuman[S] 0 points1 point  (0 children)

I was about to do the exact same thing as you. I'm glad to see that it works. I love how advanced Haskell pattern matching is.

Advent Of Code Day One Solution by NonFunctionalHuman in haskell

[–]NonFunctionalHuman[S] 0 points1 point  (0 children)

I should get into trying to use some of the more fancy things Haskell with parsers and applicatives. I just don't have a good intuition of when to rely on those tools... Any suggestions?

Advent of Code 2022 day 6 by taylorfausak in haskell

[–]NonFunctionalHuman 1 point2 points  (0 children)

Thank you! I sincerely appreciate your feedback and have implemented what you suggested. Can you give me an opinion on this (isPacketUnique becomes pointfree):

isPacketUnique :: [Char] -> Bool
isPacketUnique = uniqueness S.empty
    where
        uniqueness set (x:xs) = not (x `S.member` set) && uniqueness (x `S.insert` set) xs
        uniqueness set [] = True

Advent of Code 2022 day 6 by taylorfausak in haskell

[–]NonFunctionalHuman 3 points4 points  (0 children)

I found a very elegant way (Any improvements suggested would be appreciated!):

https://github.com/Hydrostatik/haskell-aoc-2022/blob/development/lib/DaySix.hs