ichabod801 / t_games

A collection of command-line interface games written in Python.
GNU General Public License v3.0
21 stars 4 forks source link

Freecell piles option doesn't work with challenge option #580

Closed ichabod801 closed 4 years ago

ichabod801 commented 4 years ago

The last row or two are dealt with 8 piles instead of whatever the piles option is set to.

ichabod801 commented 4 years ago

For p > 8, it deals four rows correctly, and then deals the rest as if there were only 8 tableau piles. It's not clear what the pattern of behavior is for p < 8. For p = 7 it dealt one extra card on the left most column, and p = 6 it did that for the two left most columns.

ichabod801 commented 4 years ago

I have confirmed that p = 6 through 11 deals correctly without the challenge option.

ichabod801 commented 4 years ago

Similar problem with egnellahc option.

ichabod801 commented 4 years ago

Got it. The problem is that deal_reserve_n always starts on the left. So you deal the twos, you deal the aces, and you deal the first 3 or higher on top of the first two, when you should be dealing it after the last ace. Now how do I fix that?

ichabod801 commented 4 years ago

Note that deal_aces and deal_twos are handling p < 8 correctly, and moving to the next row.

ichabod801 commented 4 years ago

Fixed it by adding a start parameter to deal_n.