diff --git a/scratch.md b/scratch.md new file mode 100644 index 0000000..6b1db2d --- /dev/null +++ b/scratch.md @@ -0,0 +1,44 @@ +# input + +1 2 +3 1 + +# rules + +1u3 1d3 1r2 1l2 1u2 1d2 1l3 1r3 +3u1 3d1 3r1 3l1 +2u1 2d1 2r1 2l1 + +# grid + ++---+---+ +|123|123| +| | | ++---+---+ +|123|123| +| | | ++---+---+ + +# cell 0x0 + +1 u1 d1 l1 r1 +2 u1 d1 l1 r1 +3 u1 d1 l1 r1 + +# cell 0x1 + +1 u1 d1 l1 r1 +2 u1 d1 l1 r1 +3 u1 d1 l1 r1 + +# cell 1x0 + +1 u1 d1 l1 r1 +2 u1 d1 l1 r1 +3 u1 d1 l1 r1 + +# cell 1x1 + +1 u1 d1 l1 r1 +2 u1 d1 l1 r1 +3 u1 d1 l1 r1 diff --git a/src/Main.elm b/src/Main.elm index b8cd49b..0a68af6 100644 --- a/src/Main.elm +++ b/src/Main.elm @@ -11,7 +11,7 @@ import Grid exposing (Grid) import Heap import Html as RootHtml import Html.Styled as Html exposing (Html) -import Html.Styled.Attributes exposing (css, style) +import Html.Styled.Attributes as Attributes exposing (css, style) import Html.Styled.Events as Events import Image exposing (Image) import Murmur3 @@ -233,7 +233,7 @@ view model = average items = List.sum items / toFloat (List.length items) in - Image.viewColor [] + Image.viewColor [ Attributes.attribute "data-count" (String.fromInt (Set.size indexes)) ] (Color.fromRGBA { red = average reds , green = average greens diff --git a/src/Wave.elm b/src/Wave.elm index 9f85ada..4f34219 100644 --- a/src/Wave.elm +++ b/src/Wave.elm @@ -222,7 +222,11 @@ propagateInDirection source cell direction ( Wave wave, todo ) = wave.entropy } , -- TODO: add this as a target for propagation if it's not already in this list - - todo + if not (List.member target todo) then + target :: todo + + else + todo ) diff --git a/template b/template new file mode 100644 index 0000000..6b1db2d --- /dev/null +++ b/template @@ -0,0 +1,44 @@ +# input + +1 2 +3 1 + +# rules + +1u3 1d3 1r2 1l2 1u2 1d2 1l3 1r3 +3u1 3d1 3r1 3l1 +2u1 2d1 2r1 2l1 + +# grid + ++---+---+ +|123|123| +| | | ++---+---+ +|123|123| +| | | ++---+---+ + +# cell 0x0 + +1 u1 d1 l1 r1 +2 u1 d1 l1 r1 +3 u1 d1 l1 r1 + +# cell 0x1 + +1 u1 d1 l1 r1 +2 u1 d1 l1 r1 +3 u1 d1 l1 r1 + +# cell 1x0 + +1 u1 d1 l1 r1 +2 u1 d1 l1 r1 +3 u1 d1 l1 r1 + +# cell 1x1 + +1 u1 d1 l1 r1 +2 u1 d1 l1 r1 +3 u1 d1 l1 r1