Skip to content

Commit

Permalink
fix bug with match merging
Browse files Browse the repository at this point in the history
  • Loading branch information
asafigan committed Aug 29, 2022
1 parent 0adc667 commit 45ac8db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ fn match_gems(
let mut index = 0;
while index < matches.len() {
let mut current = matches.remove(index);
let mut i = index;
let mut i = 0;
while i < matches.len() {
if !matches[i].tiles.is_disjoint(&current.tiles) {
let linked = matches.remove(i);
Expand All @@ -371,7 +371,7 @@ fn match_gems(
}
}

matches.insert(index, current);
matches.insert(0, current);
index += 1;
}

Expand Down

0 comments on commit 45ac8db

Please sign in to comment.