Revision 1220955

Go back to digest for 20th February 2011

Optimization in Games

Parker Coates committed changes in /trunk/KDE/kdegames/kpat/dealer.cpp:

Improve multiStepMove algorithm to make better use of available piles.

The previous implementation was explicitly optimised to use the minimum
number of piles possible. This made it usable in every situation, but
also meant that many moves were taking more steps than was actually
necessary. This was most noticeable when a lot of time was spent
unstacking and restacking cards on a couple of piles while there were
other piles going completely unused.

After some experimentation, the new algorithm uses up to 40% fewer moves
than the previous one.

File Changes

Modified 1 files
  • /trunk/KDE/kdegames/kpat/dealer.cpp
1 files changed in total