Created
November 28, 2016 14:44
-
-
Save ifyouseewendy/9c8715ba26c39dd9885bb3b0d9724d53 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
port module Main exposing (..) | |
import Html exposing (..) | |
import Html.Events exposing (..) | |
main = | |
program | |
{ init = init | |
, view = view | |
, update = update | |
, subscriptions = \_ -> Sub.none | |
} | |
type alias Model = | |
{ dieFace : Int | |
} | |
view : Model -> Html Msg | |
view model = | |
div [] | |
[ h1 [] [ text (toString model.dieFace) ] | |
, button [ onClick Roll ] [ text "Roll" ] | |
] | |
type Msg | |
= Roll | |
update : Msg -> Model -> ( Model, Cmd Msg ) | |
update msg model = | |
case msg of | |
Roll -> | |
( model, Cmd.none ) | |
init : ( Model, Cmd Msg ) | |
init = | |
( Model 1, Cmd.none ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment