aboutsummaryrefslogtreecommitdiff
path: root/src/main/solver/solver.h
blob: 526bd5386a240d07ce8a167aa4a2fba58690ef2d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// Created by thecharlesblake on 10/24/17.
//

#ifndef SOLVITAIRE_SOLVER_H
#define SOLVITAIRE_SOLVER_H

#include <string>
#include <vector>

#include "../game/global_cache.h"
#include "../game/sol_rules.h"

class solver {
public:
    global_cache cache;

    struct node {
        explicit node(game_state::move, std::vector<game_state::move>);
        const game_state::move move;
        std::vector<game_state::move> unsearched_children;
    };

    explicit solver(const game_state&);

    bool run();
    void print_solution() const;

private:
    const game_state initial_state;
    std::vector<node> frontier;
    int states_searched;
};


#endif //SOLVITAIRE_SOLVER_H