Skip to content

Commit

Permalink
fix: datatable for yacht dice & bug fix
Browse files Browse the repository at this point in the history
fix a bug that bonus is miscalculated
Rewrite Yacht Dice user interface
  • Loading branch information
z7workbench committed Apr 18, 2022
1 parent e07f078 commit 3b1f8a6
Show file tree
Hide file tree
Showing 7 changed files with 186 additions and 249 deletions.
4 changes: 3 additions & 1 deletion lib/games/dices/yacht/yacht_dice_engine.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ class DiceEngine {
bool checkBonus() {
int sum = 0;
for (int i = 0; i < 6; i++) {
sum += board[currentPlayer][i] * (i + 1);
if (board[currentPlayer][i] >= 0) {
sum += board[currentPlayer][i];
}
}
if (sum >= 63) {
return true;
Expand Down
Loading

0 comments on commit 3b1f8a6

Please sign in to comment.