Shared publicly  - 
 
For anyone that was playing around with simulations or games in gloss-web: heads-up, you'll now have to change your programs. Sorry!

Previously, the type of "initial" was your own chosen world type. Now, initial is a function:

initial :: StdGen -> World

StdGen is from System.Random, and it's a pseudorandom number generator. A nice thing to have around for a lot of games! But I'd left it out before, so you will have to change your simulations and games to add it.

The easiest way is this: if you'd previously written

initial = ...

just change it to

initial _ = ...

That _ says there's a parameter there, but you want to ignore it.
1
Mark Wotton's profile photoLiam O'Connor's profile photoChris Smith's profile photo
4 comments
 
might make sense to make it a generic Settings record, so you can update later without breaking everything again?
 
Maybe, but I'm fairly sure there's nothing else I want to add there. Random numbers were the one glaring omission. (Okay, the other one is bitmaps that could be uploaded and then used in the program, but Ben and I have talked about better solutions for that one.)
 
+Liam O'Connor I don't think it'll be too hard! I think by the time they get to simulations, they will be getting sick of everything having to follow a predetermined path and look exactly the same every time. I know I'm getting a bit frustrated by it; this animation mode can test your patience!

I think when it comes to that, I'll probably do an example of a trivial, statistically poor PRNG, such as multiplying by 23 and finding the remainder mod 101. Make a list of the first 10 to 15 numbers, and point out that they look fairly random. Maybe even talk about taking just the ones place, and leaving the tens place as RNG state. And then point out that StdGen is the same kind of thing, except better.
Add a comment...