Skip to content

Instantly share code, notes, and snippets.

@jasonneylon
Created August 11, 2017 09:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonneylon/553499eb15348374af112c31bbe91227 to your computer and use it in GitHub Desktop.
Save jasonneylon/553499eb15348374af112c31bbe91227 to your computer and use it in GitHub Desktop.
randomPoints : Generator (List(Point))
randomPoints =
Random.list 200 (Random.map (\(x, y) -> Point x y) (Random.pair (int 1 999) (int 1 399)))
-- here we create a command that the elm runtime will execute and then pass the results back via the Update function
initialModel : (Model, Cmd Msg)
initialModel =
(Model [] [] 6 0 False, (Random.generate DrawPoints randomPoints))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment