Add solver constants
This commit is contained in:
@@ -8,6 +8,7 @@ pub struct Playground {
|
||||
}
|
||||
|
||||
impl Playground {
|
||||
const POINT_SPLIT_CHAR: char = ',';
|
||||
const CIRCUITS_TAKE: usize = 3;
|
||||
|
||||
pub fn new(connections: Option<usize>) -> Playground {
|
||||
@@ -20,7 +21,7 @@ impl Playground {
|
||||
fn junction_boxes<R: BufRead>(reader: R) -> Vec<Point3> {
|
||||
let mut junction_boxes = Vec::new();
|
||||
for line in reader.lines().map_while(Result::ok) {
|
||||
let j: Vec<u64> = line.split(',').map(|s| s.parse().unwrap()).collect();
|
||||
let j: Vec<u64> = line.split(Self::POINT_SPLIT_CHAR).map(|s| s.parse().unwrap()).collect();
|
||||
junction_boxes.push(Point3(j[0], j[1], j[2]));
|
||||
}
|
||||
junction_boxes
|
||||
|
||||
Reference in New Issue
Block a user