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
-- Press a button to generate a random number between 1 and 6.
2
--
3
-- Read how it works:
4
--   https://guide.elm-lang.org/effects/random.html
5
--
6
​
7
import Browser
8
import Html exposing (..)
9
import Html.Events exposing (..)
10
import Random
11
​
12
​
13
​
14
-- MAIN
15
​
16
​
17
main =
18
  Browser.element
19
    { init = init
20
    , update = update
21
    , subscriptions = subscriptions
22
    , view = view
23
    }
24
​
25
​
26
​
27
-- MODEL
28
​
29
​
30
type alias Model =
31
  { dieFace : Int
32
  }
33
​
34
​
35
init : () -> (Model, Cmd Msg)
36
init _ =
37
  ( Model 1
38
  , Cmd.none
39
  )
40
​
41
​
42
​
43
-- UPDATE
44
​
45
​
46
type Msg
47
  = Roll
48
  | NewFace Int
49
​