Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

martay

macrumors newbie
Original poster
I'm finishing a game that starts levels off with a particular random seed so that they're repeatable all the way through. I'm trying to write the NSCoding so that the game is saved and loaded back up. The question is, what do save as a seed. I can't save the original seed because I don't (currently) keep the number of times I've asked for a number. I can get the latest random number, but I think what I really need is the last random number given out (that serves as the seed for the next number, right?).

Any suggestions? I could keep the last random number given out, but I was hoping for a more elegant solution.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.