Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Comeza committed May 26, 2024
1 parent 969c931 commit 03dcdf3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/src/game/uf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ impl UnionFind {
let liberties = (0..n).map(|i| {
let x = i % width;
let y = i / height;
return 4
- (x % (width - 1) == 0 && y % (height - 1) == 0) as usize
- (x % (width - 1) == 0 || y % (height - 1) == 0) as usize;
return 4 // Default
- (x % (width - 1) == 0 && y % (height - 1) == 0) as usize // corners
- (x % (width - 1) == 0 || y % (height - 1) == 0) as usize; // borders
});
UnionFind {
parent: (0..n).collect(),
Expand Down

0 comments on commit 03dcdf3

Please sign in to comment.