2023-04-17 16:31:47 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <optional>
|
|
|
|
#include <string>
|
|
|
|
|
2023-05-04 00:01:51 -07:00
|
|
|
#include "solver/cell.h"
|
2023-04-17 16:31:47 -07:00
|
|
|
|
|
|
|
class Puzzle {
|
|
|
|
public:
|
|
|
|
static Puzzle FromString(std::string puzzle);
|
|
|
|
|
|
|
|
std::string CurrentState();
|
|
|
|
std::string PencilMarkState();
|
|
|
|
|
2023-04-17 16:48:38 -07:00
|
|
|
bool IsSolved();
|
|
|
|
bool ApplyNextStep();
|
|
|
|
|
2023-04-17 16:31:47 -07:00
|
|
|
void AssignSquare(uint8_t id, uint8_t value);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Puzzle();
|
|
|
|
std::array<Cell, 81> cells_;
|
|
|
|
};
|