This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use itertools::Itertools; | |
use std::collections::HashSet; | |
const N6: [(i64, i64, i64); 6] = [ | |
( 1, 0, 0), (0, 1, 0), (0, 0, 1), | |
(-1, 0, 0), (0, -1, 0), (0, 0, -1) | |
]; | |
const N14: [(i64, i64, i64); 18]= [ | |
( 1, 0, 0), (0, 1, 0), ( 0, 0, 1), | |
(-1, 0, 0), (0, -1, 0), ( 0, 0, -1), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::ops::{Index, IndexMut}; | |
use itertools::Itertools; | |
struct Bitmap { | |
rows: usize, | |
cols: usize, | |
backing: Vec<bool>, | |
boundary: bool, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package aoc12 | |
import "core:fmt" | |
import "core:slice" | |
import "core:strings" | |
when ODIN_DEBUG { | |
input :: `start-A | |
start-b | |
A-c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = sum(load("in.txt")(:) == [0:8])'; | |
A = diag(ones(1, 8), 1); | |
A(9, 1) = 1; | |
A(7, 1) = 1; | |
format rat | |
sum(A^80*x) | |
sum(A^256*x) |
NewerOlder