summaryrefslogtreecommitdiff
path: root/src/solver.rs
blob: 809ddb46644898a05f3d3e2c6760f71fe073ceb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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;
}