Installed

elm/browser
1.0.2
elm/core
1.0.5
elm/html
1.0.0
elm/random
1.0.0

Registry

elm/http
2.0.0
elm/time
1.0.0
elm/file
1.0.5
elm/json
1.1.3
elm/svg
1.0.1
evancz/elm-playground
1.0.3
elm-explorations/webgl
1.1.3
w0rm/elm-physics
5.1.3
rtfeldman/elm-css
18.0.0
mdgriffith/elm-ui
1.1.8
​x
 
1
-- A button that moves to random positions when pressed.
2
--
3
-- Dependencies:
4
--   elm install elm/random
5
--
6
​
7
import Browser
8
import Html exposing (..)
9
import Html.Attributes exposing (..)
10
import Html.Events exposing (..)
11
import Random
12
​
13
​
14
​
15
-- MAIN
16
​
17
​
18
main =
19
  Browser.element
20
    { init = init
21
    , update = update
22
    , subscriptions = subscriptions
23
    , view = view
24
    }
25
​
26
​
27
​
28
-- MODEL
29
​
30
​
31
type alias Model =
32
  { x : Int
33
  , y : Int
34
  }
35
​
36
​
37
init : () -> (Model, Cmd Msg)
38
init _ =
39
  ( Model 100 100
40
  , Cmd.none
41
  )
42
​
43
​
44
​
45
-- UPDATE
46
​
47
​
48
type Msg
49
  = Clicked