Fix binary map visitor
This commit is contained in:
parent
bb350d3ec7
commit
1b4dab55c6
@ -578,6 +578,7 @@ impl<const X: usize, const Y: usize, const SIZE: usize> BinaryMapVisitor<X, Y, S
|
||||
|
||||
bw.push(MazePart::Wall);
|
||||
bw.copy(&[MazePart::Wall; X]);
|
||||
bw.copy(&[MazePart::Wall; X]);
|
||||
|
||||
let mut top_line = [MazePart::Noop; SIZE];
|
||||
let mut bottom_line = [MazePart::Noop; SIZE];
|
||||
@ -604,10 +605,8 @@ impl<const X: usize, const Y: usize, const SIZE: usize> BinaryMapVisitor<X, Y, S
|
||||
} else {
|
||||
MazePart::Wall
|
||||
});
|
||||
tl.push(MazePart::Wall);
|
||||
bl.push(MazePart::Wall);
|
||||
}
|
||||
assert!(top_line.iter().any(|b| *b != MazePart::Noop));
|
||||
assert!(bottom_line.iter().any(|b| *b != MazePart::Noop));
|
||||
|
||||
bw.copy(&top_line);
|
||||
bw.copy(&bottom_line);
|
||||
@ -732,8 +731,8 @@ mod print_tests {
|
||||
impl std::fmt::Debug for MB {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "\n");
|
||||
for x in 0..11 {
|
||||
for y in 0..11 {
|
||||
for x in 0..11 {
|
||||
let c = match self.0[y * 11 + x] {
|
||||
P => '.',
|
||||
W => '#',
|
||||
|
Loading…
Reference in New Issue
Block a user