RE: [stella] RAM usage

Subject: RE: [stella] RAM usage
From: Chris Wilkson <ecwilkso@xxxxxxx>
Date: Wed, 21 Jun 2000 00:22:03 -0400 (EDT)
On Wed, 21 Jun 2000 adavie@xxxxxxxxxx wrote:

> Haven't wee been thru all this before?  7 bits x 32 pieces = 214 bits / 8 =
> 27 bytes approx.
> I'm sure there are lots more efficient codings possible.

Yep, we went through this all before.  But I couldn't come up with anything
then.  This time, I have a bit of a contribution.  What if a piece leaves
the board?  What if a player has 9 queens?  It's better to remember what type
of piece is on each square.  So...

6 types (PRNBQK) * 2 colors + nothing = 13 possible values = 4 bits/square.

4 bits/square * 64 squares -> total = 32 bytes, uncompressed.  

With simple packing (3.70 bits/square actually needed) you can get it down
to 30 bytes.


-Chris


--
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/

Current Thread