<commit_before>module Scorched.View.Helper.Terrain where

import List (indexedMap, maximum)

import Color (black)
import Graphics.Collage (Form, Path, groupTransform, traced, solid, moveX, rect)

import Transform2D (translation)

import Scorched.Model.Geometry (Dimension)
import Scorched.Model.Terrain (Terrain)

toForm : Terrain -> Dimension -> Form
toForm terrain {width, height} =
  groupTransform
    (translation -(toFloat width / 2) 0.0)
    (drawTerrain terrain)

height : Terrain -> Int
height terrain = maximum terrain

drawTerrain : Terrain -> List Form
drawTerrain terrain = indexedMap drawLine terrain

drawLine : Int -> Int -> Form
drawLine x height = traced (solid black) (terrainLine height) |> moveX (toFloat x)<commit_msg>update terrain color<commit_after>module Scorched.View.Helper.Terrain where

import List (indexedMap, maximum)

import Color (rgb)
import Graphics.Collage (Form, Path, groupTransform, traced, solid, moveX, rect)

import Transform2D (translation)

import Scorched.Model.Geometry (Dimension)
import Scorched.Model.Terrain (Terrain)

toForm : Terrain -> Dimension -> Form
toForm terrain {width, height} =
  groupTransform
    (translation -(toFloat width / 2) 0.0)
    (drawTerrain terrain)

height : Terrain -> Int
height terrain = maximum terrain

drawTerrain : Terrain -> List Form
drawTerrain terrain = indexedMap drawLine terrain

drawLine : Int -> Int -> Form
drawLine x height = traced (solid (rgb 154 101 69)) (terrainLine height) |> moveX (toFloat x)
{'fraction_non_alphanumeric': 0.09491978609625669, 'fraction_numerical': 0.0106951871657754, 'mean_word_length': 4.84765625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '3605934', 'n_tokens_mistral': 481, 'n_tokens_neox': 443, 'n_words': 154}