sln_2017_05
Copyright(c) Eric Mertens 2017
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Main

Description

Synopsis

Documentation

main :: IO () Source #

part1 :: Int -> Int Source #

Update rules

part2 :: Int -> Int Source #

Update rules

solve Source #

Arguments

:: (Int -> Int)

update rule

-> [Int]

initial program

-> Int

steps required

Compute the number of steps until the program terminates given an update rule.

>>> solve part1 [0,3,0,1,-3]
5
>>> solve part2 [0,3,0,1,-3]
10