Skip to content

Commit

Permalink
Creater.create uses Random.split to get different renerators for
Browse files Browse the repository at this point in the history
creating the random solved puzzle and shuffling the layout.  This
porbably doesn't matter here, which is good because the generators
aren't really independent right now, as per the doc and as described
at haskell/random#25.
  • Loading branch information
tommay committed Oct 3, 2016
1 parent 5884881 commit e699132
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Creater.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import qualified System.Random.Shuffle as Shuffle

create :: Random.StdGen -> [[Int]] -> Puzzle
create rnd layout =
let puzzle = randomSolvedPuzzle rnd
layout' = shuffle rnd layout
let (rnd1, rnd2) = Random.split
puzzle = randomSolvedPuzzle rnd1
layout' = shuffle rnd2 layout
in create' puzzle layout'

create' :: Puzzle -> [[Int]] -> Puzzle
Expand Down

0 comments on commit e699132

Please sign in to comment.