<commit_before>import Time exposing (Time,second)
import Html exposing (Html,text)
import Set exposing (Set)
import Cardinal exposing (Coordinate,Bounds)
import Random


-- Model
type alias Model =
    { alive : Set Coordinate
    , bounds : Bounds
    }


init : (Model, Cmd Msg)
init =
  let
      bounds = { x = 0, y = 0, width = 10, height = 10 }
      widthCoordinateGenerator = Random.int bounds.x <| bounds.width - 1
      heightCoordinateGenerator = Random.int bounds.y <| bounds.height - 1
      locationGenerator = Random.pair widthCoordinateGenerator heightCoordinateGenerator
      listGenerator = Random.list (bounds.width * bounds.height // 2) locationGenerator
  in
    ({alive = Set.empty
    , bounds = bounds
    }, Random.generate Genesis listGenerator)


-- Messages
type Msg
    = Tick Time
    | Genesis (List(Coordinate))


-- View<commit_msg>Add function to draw SVG rectangles<commit_after>import Svg exposing (Svg)
import Svg.Attributes exposing(x, y, width, height)
import Set exposing (Set)
import Cardinal exposing (Coordinate,Bounds)
import Random


-- Model
type alias Model =
    { alive : Set Coordinate
    , bounds : Bounds
    }


init : (Model, Cmd Msg)
init =
  let
      bounds = { x = 0, y = 0, width = 10, height = 10 }
      widthCoordinateGenerator = Random.int bounds.x <| bounds.width - 1
      heightCoordinateGenerator = Random.int bounds.y <| bounds.height - 1
      locationGenerator = Random.pair widthCoordinateGenerator heightCoordinateGenerator
      listGenerator = Random.list (bounds.width * bounds.height // 2) locationGenerator
  in
    ({alive = Set.empty
    , bounds = bounds
    }, Random.generate Genesis listGenerator)


-- Messages
type Msg
    = Tick Time
    | Genesis (List(Coordinate))


drawRect : Bounds -> Int -> Int -> Coordinate -> Svg Msg
drawRect bounds svgWidth svgHeight coord =
    let
        (xPos, yPos) = coord
        w = svgWidth // bounds.width
        h = svgHeight // bounds.height
    in
        Svg.rect
            [ x <| toString <| xPos * w
            , y <| toString <| yPos * h
            , width <| toString <| w
            , height <| toString <| h
            ]
            []

-- View
{'fraction_non_alphanumeric': 0.09789569990850869, 'fraction_numerical': 0.008234217749313814, 'mean_word_length': 2.573529411764706, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 7, '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': '2072445', 'n_tokens_mistral': 674, 'n_tokens_neox': 637, 'n_words': 200}