ichabod801 / t_games

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

Solitaire games are not recognizing the deal-num option #461

Open ichabod801 opened 4 years ago

ichabod801 commented 4 years ago

This is a problem in solitaire_game.py, not in any individual game.

ichabod801 commented 4 years ago

[meant to delete this comment, closed issue instead b/c I'm so bright]

ichabod801 commented 4 years ago

If I make it an actual option, I don't think I can integrate it with the current method of asking before the game. If you enter the options through the questions, how do you stop it from asking about it (in set_solitaire) after you answer all the questions?

ichabod801 commented 4 years ago

Ah, if no question is given, it doesn't ask one during OptionSet.ask_question.

ichabod801 commented 4 years ago

What about playing again? I think that should allow for a new deal number. The second play calls set_up and thus set_solitaire again. If set_solitaire can figure out that it's a play again situation, that could be handled.

ichabod801 commented 4 years ago

The following code in OptionSet.__init__ gives the deal-num option to all solitaire games:

        # Add the deal num option to all solitaire games.
        if hasattr(self.game, 'set_solitaire'):
            self.add_option('deal-num', ['dn'], int, -1, check = lambda x: x >= -1)

But because I'm not sure that's what I want to do, I am putting this issue on hold until later.