Repost and expansion of an earlier request made when the Backserver problem was all-consuming.
According to the brilliant source, Wikipedia, to win a Pyramid game: "To be considered won, all cards (cards from the pyramid and cards from the stock) must be moved to the foundation; the game cannot be won if at least two cards cannot be moved from the stock." Unfortunately, your game stops when all cards in the pyramid are gone, even if there are cards left in the stock. I've played Pyramid the old-fashioned way and often have cleared the pyramid, but only rarely cleared the stock too. That can happen, though, and is very rewarding when it does.
Any possibility of changing the play to continue until the stock is gone and count the perfect score as 52? My grandmother always counted the cards left in the stock (after ALL parings were gone) as "the score." Your system would reverse that, counting the cards left in the pyramid PLUS the matched cards not left in the stock as the final score.
Game 256023059, if played correctly, would be a perfect game with a score of 52 (the number in the discard stack) under the traditional Pyramid game as I learned it.
One more Pyramid comment. There are times when one is moving a card from the stock to the discard pile and it totals 13 so it automatically goes in the foundation where I might like to have it remain in the discard pile in case the next card from the stock matches something in the pyramid and I could then use the prior card to use in the Pyramid. There needs to be a way to prevent automatic matching that cannot be prevented.