Bartleby2718 / DieOrDare

self-made playing card game for two players, to be played offline on Windows command line prompt
2 stars 0 forks source link

Use a sudoku-solving algorithm #85

Open Bartleby2718 opened 6 years ago

Bartleby2718 commented 6 years ago

If a value x must be in one of m decks, say Deck 3, and if there are n numbers that can be in Deck 3, what is the probability that x is in Deck 3? It's complicated. Neither 1/m nor 1/n might be the answer. Since a value in a card affects the values in the other decks, you actually have to count the number of possible cases. It's like solving a sudoku. This issue will add on to #94, although not anytime soon.

Bartleby2718 commented 5 years ago

Actually, it's just logic, not a sudoku-solving algorithm, but anyway, let me give you a concrete example. If the rightmost decks, none of which is open, are:

Deck 8 contains at least one 11, and Deck 9 contains at least one 13 besides its delegate. In fact, the possibilities are:

Case Deck 8 Deck 9
1 12, 11, 11 13, 13, 12
2 12, 11, 11 13, 12, 13
3 12, 11, 12 13, 13, 11
4 12, 12, 11 13, 13, 11
5 12, 11, 12 13, 11, 13
6 12, 12, 11 13, 11, 13

For done, both Deck 8 and Deck 9 must be opened, so maybe you should look for other numbers first. On the other hand, the big sums can be used to dare some of the biggest decks the opponent has. Finally, there is a guarantee that joker is in neither of Deck 8 and Deck 9.

Bartleby2718 commented 5 years ago

Some links on sudoku-solving algorithms:

The problem is that I have no idea how I should implement this... (because I haven't looked into it yet)

Bartleby2718 commented 5 years ago

Another example:

In this case, Deck 1 has to be {2, 1, 1} and Deck 2 has to be {4, 4, 3} because it is the only possible case, although it may be evident at first glance.

Bartleby2718 commented 5 years ago

What concerns me is that this is clearly a logical but may not worth the computing time.