From edaccaaf15a526714f3de4e9e044341abd037885 Mon Sep 17 00:00:00 2001 From: natrixaeria Date: Thu, 2 Jan 2020 15:34:07 +0100 Subject: Start to implement incremental block solver --- src/solver.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/solver.rs') diff --git a/src/solver.rs b/src/solver.rs index c289cd6..809ddb4 100644 --- a/src/solver.rs +++ b/src/solver.rs @@ -1,9 +1,17 @@ use crate::structs::StoneWall; +/// calculate h and w +pub fn wall_stats(n: u32) -> (u32, u32) { + let h = (n >> 1) + 1; + (h, (n - 1) * h) +} + pub trait Solver { fn new(n: u32) -> Self; fn solve(&mut self) -> StoneWall; fn n(&self) -> u32; + fn h(&self) -> u32; + fn w(&self) -> u32; } -- cgit v1.2.3-70-g09d2