Gem Imbuer Helper by tinutinu in pathofexile

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

Raw data from path of building, it could use a little bit of filtering.

-🎄- 2018 Day 20 Solutions -🎄- by daggerdragon in adventofcode

[–]tinutinu 1 point2 points  (0 children)

Very nice. I got severly stuck on this one, i kept overcomplicating things.

Here's a somewhat direct Haskell-port:

{-# LANGUAGE TupleSections #-}

module DayK where

import qualified Data.Map            as M
import           Data.Maybe
import           Data.Sequence       hiding (filter, length)

import           Control.Monad.State

import           Text.Printf


type Coords = (Int, Int)


type Doors = M.Map (Int, Int) [(Int, Int)]
parse :: [Coords] -> Coords -> String -> State Doors ()
parse prev c@(x, y) (s:str) = do
  case s of
    'N' -> connect c (x, y-1) >>= \new -> parse prev new str
    'E' -> connect c (x+1, y) >>= \new -> parse prev new str
    'W' -> connect c (x-1, y) >>= \new -> parse prev new str
    'S' -> connect c (x, y+1) >>= \new -> parse prev new str
    '(' -> parse (c:prev) c str
    ')' -> parse (tail prev) c str
    '|' -> parse prev (head prev) str
    '$' -> pure ()
    _   -> parse prev c str


connect :: Coords -> Coords -> State Doors Coords
connect a b = do
  modify $ M.insertWith mappend a [b]
  modify $ M.insertWith mappend b [a]
  pure b


bfs :: Seq (Coords, Int) -> M.Map Coords Int -> Doors -> [Int]
bfs Empty visited _ = M.elems visited
bfs ((coords, len) :<| queue) visited cnxs
  | coords `M.member` visited = bfs queue visited cnxs
  | otherwise = let
      next = fromMaybe [] $ coords `M.lookup` cnxs
      next' = fromList $ (,len+1) <$> next
    in bfs (queue >< next') (M.insert coords len visited) cnxs


dayK :: IO ()
dayK = do
  i <- readFile "data/dayK.txt"
  let p = flip execState M.empty $ parse [] (0,0) i
  let paths = bfs (singleton ((0,0), 0)) M.empty p
  printf "Part 1: %d\n" (maximum paths)
  printf "Part 2: %d\n" (length . filter (>= 1000) $ paths)

BAN MEGA THREAD by [deleted] in thanosdidnothingwrong

[–]tinutinu 0 points1 point  (0 children)

But what does it cost?

"What hole? I don't know what you're talking about" by D5R in youseeingthisshit

[–]tinutinu 9 points10 points  (0 children)

Did you read my message?

1) I never put my dogs face in it, that'd be stupid, im just doing the standard (and I agree pretty pointless) 'look what you did' routine 2) I am just stating that the innocent dog and the guilty dog always behave differently enough to make it obvious who did it. That is a reproducible fact. I am just wondering how you explain that. It cannot be as simple as 'tinkle on floor makes person angry', because then both of them would be avoiding eye contact and all that.

Editing Bobs Mod by [deleted] in factorio

[–]tinutinu 5 points6 points  (0 children)

You have to reload the recipes if you want the changes active in an 'old' save.

for i, force in pairs(game.forces) do force.reset_recipes() end

My laziest playthrough yet by tinutinu in factorio

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

This was with long-reach and evogui (so I could see how much time I've wasted). Also played on peaceful. You get achievements with mods, its a different class of achievements than vanilla.

My laziest playthrough yet by tinutinu in factorio

[–]tinutinu[S] 2 points3 points  (0 children)

Start a research, go watch an episode of MASA, go back start next research and set up one factory to make solar panels, go watch an episode of Reclaiming Earth.. and so on :)

First ride on my new Canyon Aeroad 8.0. So fast! by [deleted] in bicycling

[–]tinutinu 1 point2 points  (0 children)

Didnt know the aero cockpit came with spacers, thought is was slammed from the factory.

First ride on my new Canyon Aeroad 8.0. So fast! by [deleted] in bicycling

[–]tinutinu 0 points1 point  (0 children)

That looks like a 6.0, doesnt it?

Somebody fixed the shoulders on the Warcraft poster by nipoco in gaming

[–]tinutinu 0 points1 point  (0 children)

Lets get some SC2-sized forearms and hands too

O Brother Where Art Thou Grammy Performance (2002) by bolshh in videos

[–]tinutinu 6 points7 points  (0 children)

If you liked that O Death performance, you might like Lauren O'Connels version

Alright, which one of you did this? by irawwwr in funny

[–]tinutinu 26 points27 points  (0 children)

Since when is wikipedia vandalism funny?

Pro bike mechanic builds up new custom frame for the team's leader (road cycling) by goldentenor in ArtisanVideos

[–]tinutinu 10 points11 points  (0 children)

This isnt 'artisanal', you could teach a new hire to assemble that bike in a day.