Skip to content

Commit

Permalink
LOCK IN
Browse files Browse the repository at this point in the history
  • Loading branch information
alion02 committed Dec 7, 2024
1 parent 2054467 commit 4a8c140
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/day6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ unsafe fn inner2(s: &[u8]) -> u32 {
while y != c {
*tables.visited.get_unchecked_mut(y).get_unchecked_mut(x) |= 1;
y -= 1;
if !*tables.visited.get_unchecked(y).get_unchecked(x) != 0 {
if *tables.visited.get_unchecked(y).get_unchecked(x) == 0 {
toggle_wall!(x, y);
total += go_right(&mut tables, masks, x, y + 1) as u32;
toggle_wall!(x, y);
Expand All @@ -304,7 +304,7 @@ unsafe fn inner2(s: &[u8]) -> u32 {
while x != c {
*tables.visited.get_unchecked_mut(y).get_unchecked_mut(x) |= 2;
x += 1;
if !*tables.visited.get_unchecked(y).get_unchecked(x) != 0 {
if *tables.visited.get_unchecked(y).get_unchecked(x) == 0 {
toggle_wall!(x, y);
total += go_down(&mut tables, masks, x - 1, y) as u32;
toggle_wall!(x, y);
Expand All @@ -320,7 +320,7 @@ unsafe fn inner2(s: &[u8]) -> u32 {
while y != c {
*tables.visited.get_unchecked_mut(y).get_unchecked_mut(x) |= 4;
y += 1;
if !*tables.visited.get_unchecked(y).get_unchecked(x) != 0 {
if *tables.visited.get_unchecked(y).get_unchecked(x) == 0 {
toggle_wall!(x, y);
total += go_left(&mut tables, masks, x, y - 1) as u32;
toggle_wall!(x, y);
Expand All @@ -337,7 +337,7 @@ unsafe fn inner2(s: &[u8]) -> u32 {
while x != c {
*tables.visited.get_unchecked_mut(y).get_unchecked_mut(x) |= 8;
x -= 1;
if !*tables.visited.get_unchecked(y).get_unchecked(x) != 0 {
if *tables.visited.get_unchecked(y).get_unchecked(x) == 0 {
toggle_wall!(x, y);
total += go_up(&mut tables, masks, x + 1, y) as u32;
toggle_wall!(x, y);
Expand Down

0 comments on commit 4a8c140

Please sign in to comment.