sudoku-solver-cpp/solver/cell.h
Drew Galbraith bcc5b5097e First pass at a sudoku solver: Puzzle Import
Imports a puzzle from a string and displays the restricted puzzle.
2023-04-17 16:31:47 -07:00

26 lines
448 B
C++

#pragma once
#include <stdint.h>
#include <array>
class Cell {
public:
enum State {
Unsolved,
Solved,
};
Cell();
explicit Cell(uint8_t value);
void Restrict(uint8_t value);
bool IsSolved() const { return state_ == Solved; }
uint8_t value() const { return value_; }
bool IsPossible(uint8_t v) const { return possibilities_[v - 1]; }
private:
State state_;
uint8_t value_;
std::array<bool, 9> possibilities_;
};