Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
zlu
zlu.me
Commits
d30cb31f
Commit
d30cb31f
authored
Jul 13, 2016
by
zlu
🤸🏿
Browse files
User sees initial value and roll button
parent
16b9a2b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
random-number.elm
random-number.elm
+35
-0
No files found.
random-number.elm
0 → 100644
View file @
d30cb31f
import
Html
exposing
(
..
)
import
Html
.
Events
exposing
(
onClick
)
import
Html
.
App
as
App
main
=
App
.
program
{
init
=
init
,
view
=
view
,
update
=
update
,
subscriptions
=
subscriptions
}
type
alias
Model
=
{
dieFace
:
Int
}
type
Msg
=
Roll
init
:
(
Model
,
Cmd
Msg
)
init
=
(
Model
1
,
Cmd
.
none
)
update
:
Msg
->
Model
->
(
Model
,
Cmd
Msg
)
update
msg
model
=
case
msg
of
Roll
->
(
model
,
Cmd
.
none
)
view
:
Model
->
Html
Msg
view
model
=
div
[]
[
h1
[]
[
text
(
toString
model
.
dieFace
)
]
,
button
[
onClick
Roll
]
[
text
"
Roll"
]
]
subscriptions
:
Model
->
Sub
Msg
subscriptions
model
=
Sub
.
none
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment