alnah005 / Konkan

Flutter game that is popular in my home country (Yemen)
1 stars 0 forks source link

Bot set a group of 2 4s and 2 jokers #51

Closed alnah005 closed 4 years ago

alnah005 commented 4 years ago

Weird bug with getting the group score. Bot was able to set groups with only one group of 4s.

image

FaisalAlwazir commented 4 years ago

is there anyway to recreate the bug within tests?

alnah005 commented 4 years ago

is there anyway to recreate the bug within tests?

Yea just have a group of what I have in the photo and set it to player.cards and then call player.setCards(51), you'll see the cards were set and open.cards would contain the group.

alnah005 commented 4 years ago

I think you should check the playing card penalty values. I put them as 52 for jokers (because that's the penalty you get if the game is done and you have it in your hand)

FaisalAlwazir commented 4 years ago

i printed out the values of a meld inside tests

A suit meld worth 40 with cards: JKR Q♢ Q♥ Q♧

it says its penaltyval is 40 so I dont think the issue is with the joker having a penalltyVal of 52

are you using the meld.penalty property to get the penalty value of set cards? if so could you point out the code that does that?

FaisalAlwazir commented 4 years ago

oh yes there is a bug.

bug

FaisalAlwazir commented 4 years ago

found the error. groups.dart line 211 groupType, remainingSuits.toList()[1], jokerPositions[1]); instead of groupType, remainingSuits.toList()[1], jokerPositions[0]); haha

FaisalAlwazir commented 4 years ago

Fixed after https://github.com/alnah005/Konkan/commit/04507e43b432603c9b7a7fb810d58a1703364fb1