Skip to content
Permalink
Browse files

Pass our 'special' seed from javascript through a flag

  • Loading branch information...
magopian committed Aug 8, 2019
1 parent 7b5a3e8 commit 3677ba73201269c673eb3cec57381561e73f68ec
Showing with 5 additions and 4 deletions.
  1. +2 −1 index.html
  2. +3 −3 src/Main.elm
@@ -10,7 +10,8 @@
<div id="elm"></div>
<script>
var app = Elm.Main.init({
node: document.getElementById('elm')
node: document.getElementById('elm'),
flags: 42
});
</script>
</body>
@@ -82,11 +82,11 @@ type alias Score =


type alias Flags =
()
Int


init : Flags -> ( Model, Cmd Msg )
init _ =
init seed =
( { ball = initBall
, rightPaddle = RightPaddle <| initPaddle 480
, leftPaddle = LeftPaddle <| initPaddle 10
@@ -97,7 +97,7 @@ init _ =
{ rightPlayerScore = 0
, leftPlayerScore = 0
}
, seed = Random.initialSeed 42
, seed = Random.initialSeed seed
}
, Cmd.none
)

0 comments on commit 3677ba7

Please sign in to comment.
You can’t perform that action at this time.