Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show a count of non-optimal card flips #35

Open
Keisial opened this issue Aug 12, 2021 · 5 comments
Open

Show a count of non-optimal card flips #35

Keisial opened this issue Aug 12, 2021 · 5 comments

Comments

@Keisial
Copy link

Keisial commented Aug 12, 2021

The Memo game counts the number of tries. However, due to the random distribution of the deck, this doesn't always properly reflect how well the user played. As such, it would be desirable to include a count of the non-optimal card flips taken by the user (less is better).

A card flip is deemed non-optimal if:

  • The card had already been flipped previously (i.e. the user should know its contents) and
  • After finishing the turn, the pair of cards flipped don't match

OR

  • This is the second flip of this turn and
  • The two cards don't match and
  • The card matching the first one had been flipped in this game (so it could have been chosen instead)

For example, given the following board:

A B C D
E F a b
c d e f

The user could do:

  1. A (optimal, unknown card), B (optimal, unknown card)
  2. C (optimal, unknown card), a (optimal, the card was unknown)
  3. a (optimal only if followed by A), A (optimal as it makes a pair)
  4. b (optimal, unknown card), d (non-optimal, should have flipped B)
  5. E (optimal, unknown card), d (non-optimal, it had already been flipped)
  6. d (non-optimal since it isn't followed by D), e (optimal, unknown card)
  7. D (optimal, unknown card), d (optimal, matches the previous one)
  8. f (optimal, unknown card), e (non-optimal, card was known not to be F)
  9. f (non-optimal, known card, and not followed by F), c (optimal, unknown card)
  10. f (optimal despite having been flipped, since followed by F), F (optimal, unknown card, plus it forms a pair)
  11. B (optimal), b (optimal)
  12. C (optimal), c (optimal)
  13. E (optimal), e (optimal)

With a total of 5 non-optimal flips, which with a perfect play should have been zero.

Note that in 10 the user knew the card at F, despite not having flipped it, and thus it isn't non-optimal to begin by flipping f, since it correctly pick its pair.

@Sidahmed-ben
Copy link

Sidahmed-ben commented Jan 30, 2022

Hello @petermayer , I am interested by the issue, I would like to know if you are still active on the project because i can find a solution. thank you

@petermayer
Copy link

Hi @Sidahmed-ben, yes the project is still active, but we are just currently working on other PFAs. If you can contribute a patch for this issue, it is highly appreciated! However, I feel it might be good to keep both ways of counting and give the user the info X flips needed to solve with Y optimal and Z non-optimal flips, where X=Y+Z.

@Sidahmed-ben
Copy link

Sidahmed-ben commented Feb 7, 2022

@petermayer @sleep-yearning @hanneshofmann thank you for the reply , so to dispaly the score when playing, i keep the number of tries and i add another score Y,Z that I increment after each flip. At the end I display the final score X = Y + Z .Do you think that it's okay or do you have another suggestion ! 😇

@petermayer
Copy link

@Sidahmed-ben That seems fine! 👍

@Sidahmed-ben
Copy link

@petermayer Great 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants