Skip to content

Instantly share code, notes, and snippets.

@ifyouseewendy
Created November 28, 2016 14:44
Show Gist options
  • Save ifyouseewendy/9c8715ba26c39dd9885bb3b0d9724d53 to your computer and use it in GitHub Desktop.
Save ifyouseewendy/9c8715ba26c39dd9885bb3b0d9724d53 to your computer and use it in GitHub Desktop.
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