tom-james-watson / wikitrivia

Wikidata as a trivia card game.
https://wikitrivia.tomjwatson.com
MIT License
497 stars 87 forks source link

if 2 cards have the same year positioning before or after is correct #74

Closed migius closed 2 years ago

migius commented 2 years ago

In checkCorrect admit any positioning if the year is the same

resolve:#8

migius commented 2 years ago

I think that this change can solve a bug and don't change the game logic but of course it is useless if #57 or #73 will be approved

benguaraldi commented 2 years ago

@migius At least if #57 is implemented, two cards can still have the same year if there are no cards that are sufficient distance apart. That's only going to happen if a player places hundreds of cards correctly, but it's still worth having the correct behavior.

As such, I've added the logic from your PR into #57. Thanks!

tom-james-watson commented 2 years ago

Do you have an easy way for me to verify this fix?

benguaraldi commented 2 years ago

@tom-james-watson The way I verified this (before trying to add it along with the kitchen sink in #57) was:

Then I repeated the above steps with after.

Note that it didn't occur to me to see what happens if there are two items of the same year and a third is presented from the deck, but that's probably worthwhile to test.

migius commented 2 years ago

for test it I alter some dates in browser console

tom-james-watson commented 2 years ago

I believe this should be fixed by https://github.com/tom-james-watson/wikitrivia/pull/57 :pray: