space complexity - Solitaire: storing guaranteed wins cheaply -
given list of deals of klondike solitaire known win, there way store reasonable amount of deals (say 10,000+) in reasonable amount of space (say 5mb) retrieve on command? (these numbers arbitrary)
i thought of using pseudo random generator given seed generate decimal string of numbers, each 2 digits represents card, , index represents location of deal. in case, have store seed , prg code.
the cons can think of a) number of possible deals 52!, , number of possible seeds @ least 52!, , monstrous store in higher number range, , b) generated number can't repeat 2 digit number (though can ignored in deck construction)
given no prior information, theoretical limit on how compactly can represent ordered deck of cards 226 bits. simple naive 6-bits-per card 312 bits, won't gain being clever.
if you're willing sacrifice large part of state-space, use 32- or 64-bit prng generate decks, , reproduce them 32- or 64-bit initial prng state. limits 2^64 different decks out of possible 2^225+.
Comments
Post a Comment