Before I read your current message, I want to reopen our previous
discussions on the number of cards that can be moved during a multi-card
move.
/* using your notation where F = number of empty free cells, and C =
number of empty columns */
My equation is: ( F + 1 ) * ( 2 ** C )
Your equation is: ( C * C + C ) / 2 + C * F + F + 1
I wrote a quick program to compare the two equation for 0..4 empty free
cells and 0..7 empty columns. The results are listed below. Obviously,
there's a discrepancy! For sure, we are both wrong when F = 0 and C > 0
because only one move is allowed.
(F,C) = my_results your_results
(0,0) = 1 1
(0,1) = 2 2
(0,2) = 4 4
(0,3) = 8 7
(0,4) = 16 11
(0,5) = 32 16
(0,6) = 64 22
(0,7) = 128 29
(1,0) = 2 2
(1,1) = 4 4
(1,2) = 8 7
(1,3) = 16 11
(1,4) = 32 16
(1,5) = 64 22
(1,6) = 128 29
(1,7) = 256 37
(2,0) = 3 3
(2,1) = 6 6
(2,2) = 12 10
(2,3) = 24 15
(2,4) = 48 21
(2,5) = 96 28
(2,6) = 192 36
(2,7) = 384 45
(3,0) = 4 4
(3,1) = 8 8
(3,2) = 16 13
(3,3) = 32 19
(3,4) = 64 26
(3,5) = 128 34
(3,6) = 256 43
(3,7) = 512 53
(4,0) = 5 5
(4,1) = 10 10
(4,2) = 20 16
(4,3) = 40 23
(4,4) = 80 31
(4,5) = 160 40
(4,6) = 320 50
(4,7) = 640 61
HELSER ERIC JOSEPH wrote:
> I think you're right about the 'f' thing. My program has been running
> for about 2 hours now, and it's hanging around 40 moves in. Most of
> which are rundundant moves.
>
> Here's my next idea to reduce stupid moves:
>
> 1. Convert 'f' notation to 'a,b,c,d...'.
> 2. Create another array called the "ban list".
> 3. Whenever a move is made, add its reverse to the ban list. For
> example, if you move '12', then '21' will be an illegal move until
> column 1 is modified.
>
> Working example: MS deal #1
> (current move) ~ ban list
> 1a ~ a1
> 1b ~ b1 (a1 was removed)
> 1c ~ c1 (b1 was removed)
> 61 ~ 16 (rest were removed because '1' was modified)
> 61 ~ 16 (it's already here)
> 6d ~ d6 (16 was removed)
> 67 ~ 76 (d6 was removed)
> a7 ~ 76, 7a (76 was NOT removed)
> 16 ~ 7a...
>
> Good thing I worked that out, because now I actually understand how it
> works. Has this been done before?
>
> Let X = any table or free cell
> Let Y = any table or free cell
> Let Z = any table or free cell
>
> If XY is on the ban list, you may not make move XY until either move
> ZY or YZ is made.
>
> The question that remains is: should I made this a dynamic list,
> created each time the "temporary" table is evaluated, or do I make
> this an addition onto the list of moves made, so I don't have to keep
> recreating the ban list every time I want to determine the legality of
> a potential next move? The quicker way, to make an array, would be
> less time consuming but more memory consuming.
>
> Also, what do I do if I want to utilize more freecells? I can't go "a,
> b, c, d, e, f, g, h..." because 'h' is reserved for 'home'. Maybe if I
> just skipped over it and went to 'i' instead?
>
> Well, this ban list works just peachy for beginning- and mid-game
> tactics, but when there is lots of free space, there would have to be
> scores of banned moves listed... maybe I'll tell it that moving a
> complete stack to another open column is a no-no. Ah, I'll figure it
> out when I get there!
>
> This weekend I thought I couldn't do this, but I've come around a lot.
> This is fun! Lots of revamping to do...
Received on Tue Nov 18 2003 - 19:33:58 IST