#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);

  uint8_t NumPossibilities();

  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_;
};
