Skip to content

Instantly share code, notes, and snippets.

@SuperCipher
Created March 16, 2021 12:17
Show Gist options
  • Save SuperCipher/044945796324775ee8105572b0183d3b to your computer and use it in GitHub Desktop.
Save SuperCipher/044945796324775ee8105572b0183d3b to your computer and use it in GitHub Desktop.
elm list data gen
-- [[13,41,3,94,59], [59,79,70], [ 15,41,81], [11]]
-- [[94,59,41,13,3],[79,70,59],[81,41,15],[11]]
sampleData : List (List Float)
sampleData =
-- [[13,41,3,94,59], [59,79,70,0,0], [15,41,81,0,0], [11,0,0,0,0]]
padAll [[13,41,3,94,59], [59,79,70], [ 15,41,81], [11]]
zeroPad : Int -> List Float -> List Float
zeroPad target ns =
let
length = List.length ns
paddingLength = if length >= target then 0 else (target - length)
pad = List.repeat paddingLength 0
in
ns ++ pad
padAll : List (List Float) -> List (List Float)
padAll ls =
case ls of
head :: tail ->
head :: List.map (zeroPad <| List.length head) tail
[] ->
[]
-- increase bid
stackQuantity : List Int
stackQuantity =
List.range 1 2
-- actual bid
xRange : Int -> List Int
xRange range =
List.range 1 range
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment