aoc2020-0.1.0.0: Development environment for Advent of Code challenges
LicenseBSD3
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

AOC.Challenge.Day17

Description

 
Synopsis

Documentation

runDay17 Source #

Arguments

:: Bool

cache neighbors between runs

-> Bool

use an up-front vector cache (instead of dynamic memotable)

-> Int

number of steps

-> Int

dimensions

-> Set Point

points

-> [IntMap IntSet]

steps

ixPascal Source #

Arguments

:: Int

dimension

-> Int 
-> [Int] 

ixPascalRef Source #

Arguments

:: Int

dimension

-> Int 
-> [Int] 

encRun :: Int -> [Int] -> [Int] Source #

vecRunIxPascal Source #

Arguments

:: Int

dimension

-> Int

maximum

-> Int

number

-> [Int]

run

genVecRunIxPascal Source #

Arguments

:: Int

dimension

-> Int

maximum

-> Int

number

-> [Int]

runs, but reverse order

oldNeighborWeights Source #

Arguments

:: Int

dimension

-> Int

maximum

-> Vector (IntMap NCount) 

vecRunNeighbs Source #

Arguments

:: Int

dimension

-> Int

maximum

-> Int 
-> [(Int, NCount)] 

Streaming/constant space enumerate all neighbor and multiplicities

vecRunNeighbsInt Source #

Arguments

:: Int

dimension

-> Int

maximum

-> Int 
-> [(Int, Integer)] 

Streaming/constant space enumerate all neighbor and multiplicities

vecRunNeighbs_ :: Vector Int -> [(Vector Int, NCount)] Source #

Reference implementation for vecRunNeighbs, which takes and returns actual vec run neighbors

neighborWeights Source #

Arguments

:: Int

dimension

-> Int

maximum

-> Vector (IntMap NCount) 

Build up all the weights for quick reference comparison

finalWeight Source #

Arguments

:: (Num a, Ord a) 
=> Int

dim

-> [a] 
-> Integer 

binom :: Int -> Int -> Int Source #

chompPascal :: Int -> (Int, Int) -> (Int, Int, (Int, Int)) Source #