Hi!
I've also registered to this mailing-list from my home account, and
besides, made this mailing-list open, so Markus Oberhumer can also send
messages here.
Anyway, the main difference between Klondike and Freecell-like games is the
queue in the top. (I believe it is called a talon). This talon is not very
hard to implement computer-wise and occupies only 20 bytes of space.
However, it is not needed by Freecell-like games and the Freecells are not
needed by Klondike.
Furthermore, in further games we are going to implement, there may be other
gaming constructs, and supplying a fixed space for each one is a waste of
space, unless we use something like INDIRECT_STACK_STATES of course, in
which case each one will occupy only 4 or 8 bytes depending on the computer
architecture. But INDIRECT_STACK_STATES is slower than COMPACT_STATES, so I
believe we should support them both even for this.
I have the following idea which can solve the problem IMO: there will be a
"global" (i.e: common to all states of the same game) vector of offsets,
which will signify where the stacks begin, where the talon begins, where
the freecells begin, etc. The offset with index 0 will contain the stacks,
the offset with index 1 will contain the freecells, the offset with index 2
the foundations, the offset with index 3 the talon, and so on, as new games
are added.
At the beginning of each game, the program will calculate where everything
should be according to the game that was specified, and then set the
offsets. That way no space will be set, and each element of the game can be
accessed in O(1) time. It would make it a bit slower, but not considerably IMO.
Does everybody agree?
Regards,
Shlomi Fish
----------------------------------------------------------------------
Shlomi Fish shlomif_at_techie.com
Home Page:
http://t2.technion.ac.il/~shlomif/
I don't believe in fairies. Oops! A fairy died.
I don't believe in fairies. Oops! Another fairy died.
Received on Wed Feb 14 2001 - 23:13:34 IST