<commit_before>module Components.Zombie where

import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import String
import Window
import Effects exposing (Effects)
import Random exposing (Seed)

type Action
  = NoOp

type alias Tile =
  { revealed: Bool
  , name: String
  }

type alias Model =
  { seed: Seed
  , tiles: List Tile
  }

newTile : String -> Tile
newTile name = Tile False name

revealedTile : String -> Tile
revealedTile name = Tile True name

gameTiles = List.map newTile ["h1", "h1", "h2", "h2", "h3", "h3", "h4", "h4", "h5", "h5", "gy", "zo", "zo", "zo"]

tileHtml : Tile -> Html
tileHtml tile =
  let
    backClassname = "back " ++ tile.name

    revealed = if tile.revealed then " revealed" else ""

    tileClass = "tile" ++ revealed
  in
  div
    [ class "cell" ]
    [
      div [ class tileClass ]
      [
        div [ class "front" ] [ ],
        div [ class backClassname ] []
      ]
    ]

lineHtml : List Tile -> Html
lineHtml tileList =
  div [ class "line" ] (List.map tileHtml tileList)

boardHtml : List (List Tile) -> Html
boardHtml tileList = div [ class "board clearfix" ]
                         (List.map lineHtml tileList)


view : Signal.Address Action -> Model -> Html
view address model = boardHtml [[revealedTile "h1", revealedTile "h1", revealedTile "h2", revealedTile "h2"],
          [revealedTile "h3", revealedTile "h3", revealedTile "h4", revealedTile "h4"]]

update : Action -> Model -> (Model, Effects Action)
update action model =
  (model, Effects.none)<commit_msg>Update view function to display all game tiles using chunk<commit_after>module Components.Zombie where

import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import String
import Window
import Effects exposing (Effects)
import Random exposing (Seed)
import Exts.List exposing (chunk)


type Action
  = NoOp

type alias Tile =
  { revealed: Bool
  , name: String
  }

type alias Model =
  { seed: Seed
  , tiles: List Tile
  }

newTile : String -> Tile
newTile name = Tile False name

revealedTile : String -> Tile
revealedTile name = Tile True name

gameTiles = List.map revealedTile ["h1", "h1", "h2", "h2", "h3", "h3", "h4", "h4", "h5", "h5", "h6", "h6", "gy", "zo", "zo", "zo"]

tileHtml : Tile -> Html
tileHtml tile =
  let
    backClassname = "back " ++ tile.name

    revealed = if tile.revealed then " revealed" else ""

    tileClass = "tile" ++ revealed
  in
  div
    [ class "cell" ]
    [
      div [ class tileClass ]
      [
        div [ class "front" ] [ ],
        div [ class backClassname ] []
      ]
    ]

lineHtml : List Tile -> Html
lineHtml tileList =
  div [ class "line" ] (List.map tileHtml tileList)

boardHtml : List (List Tile) -> Html
boardHtml tileList = div [ class "board clearfix" ]
                         (List.map lineHtml tileList)


view : Signal.Address Action -> Model -> Html
view address model = boardHtml (chunk 4 model.tiles)

update : Action -> Model -> (Model, Effects Action)
update action model =
  (model, Effects.none)
{'fraction_non_alphanumeric': 0.1264629388816645, 'fraction_numerical': 0.010078023407022107, 'mean_word_length': 2.996103896103896, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3276364', 'n_tokens_mistral': 1042, 'n_tokens_neox': 1001, 'n_words': 337}