Skip to content

Commit

Permalink
add debug information to output grid
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Jan 10, 2020
1 parent 2701117 commit 39fce03
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 3 deletions.
44 changes: 44 additions & 0 deletions 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
4 changes: 2 additions & 2 deletions src/Main.elm
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion src/Wave.elm
Expand Up @@ -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
)


Expand Down
44 changes: 44 additions & 0 deletions 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

0 comments on commit 39fce03

Please sign in to comment.