connected-web / gamebot

A slackbot for board games and games channels. Responds to gameplay related chatter.
2 stars 0 forks source link

End game victor is calculated incorrectly - lowest card seems to win instead of highest. #65

Closed johnbeech closed 6 years ago

johnbeech commented 6 years ago

Seen several times; on investigation of code I spotted a few potential bug with the sort algorithm - not checking the right card properly, and also might be sorting in reverse; lowest card first.

johnbeech commented 6 years ago

Created a test for a three player game, where the state before the final card involved a King, a Princess, and a Countess. Have proved that the sort algorithm was working in reverse - the player with the King won on first test.

johnbeech commented 6 years ago

Also fixed a variable undefined error which was crashing the game with a stack trace at the end of the round.