use crate::structs::{StoneWall, GapHeights}; #[derive(Clone)] struct State { stones_used: Vec, gaps: GapHeights, } impl State { fn from_gaps(gaps: GapHeights, n: u32) -> Self { let h = n/2 + 1; Self { stones_used: vec![false; n * h], gaps } } fn stone_used(&self, n: u32, h: u32) -> bool { self.stones_used.get() } fn as_wall(&self, n: u32) -> StoneWall { self.gaps.as_stone_wall(n) } } struct RecursiveSolver { n: u32, states: Vec } impl Sover for RecursiveSolver { fn new(n: u32) -> Self { let w = (n/2 + 1) * (n - 1); let gaps = GapHeights::create_empty(w); Self { n, states: vec![State::from_gaps(gaps)] } } fn solve(&mut self) -> Option { let w = self.w(); if let Some(state) = self.states.last() { } } fn n(&self) -> u32 { self.n } }