always check if tile-group is ative separately from counting group members
This commit is contained in:
parent
083bafc357
commit
fbdf776141
14
src/azul.rs
14
src/azul.rs
|
@ -697,13 +697,14 @@ impl Player {
|
||||||
let mut count = 0;
|
let mut count = 0;
|
||||||
let mut active = false;
|
let mut active = false;
|
||||||
for i in 0..5 {
|
for i in 0..5 {
|
||||||
|
if (row, i) == (row, column) {
|
||||||
|
active = true;
|
||||||
|
}
|
||||||
|
|
||||||
if active == true && wall[row][i] == false {
|
if active == true && wall[row][i] == false {
|
||||||
break;
|
break;
|
||||||
} else if wall[row][i] == false {
|
} else if wall[row][i] == false {
|
||||||
count = 0;
|
count = 0;
|
||||||
} else if (row, i) == (row, column) {
|
|
||||||
active = true;
|
|
||||||
count += 1;
|
|
||||||
} else {
|
} else {
|
||||||
count += 1
|
count += 1
|
||||||
}
|
}
|
||||||
|
@ -714,13 +715,14 @@ impl Player {
|
||||||
let mut count = 0;
|
let mut count = 0;
|
||||||
let mut active = false;
|
let mut active = false;
|
||||||
for i in 0..5 {
|
for i in 0..5 {
|
||||||
|
if (i, column) == (row, column) {
|
||||||
|
active = true;
|
||||||
|
}
|
||||||
|
|
||||||
if active == true && wall[i][column] == false {
|
if active == true && wall[i][column] == false {
|
||||||
break;
|
break;
|
||||||
} else if wall[i][column] == false {
|
} else if wall[i][column] == false {
|
||||||
count = 0;
|
count = 0;
|
||||||
} else if (i, column) == (row, column) {
|
|
||||||
active = true;
|
|
||||||
count += 1;
|
|
||||||
} else {
|
} else {
|
||||||
count += 1
|
count += 1
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue