Skip to content
Snippets Groups Projects
Commit 75cd69ef authored by Silas Dohm's avatar Silas Dohm
Browse files

history added

parent 48e8331e
Branches
No related tags found
1 merge request!1Master
......@@ -26,7 +26,6 @@ public slots:
void addOption(int x);
void removeOption(int x);
void collapse(int x);
private slots:
void un(void);
};
......
......@@ -72,6 +72,7 @@ Window::Window(QWidget *parent)
void Window::solveButtonClicked()
{
// std::array<Cell,81> start = m_cell;
std::list<Cell*> hist;
srand(time(NULL));
while (1)
{
......@@ -101,12 +102,18 @@ void Window::solveButtonClicked()
return;
}
else if(minEtropy ==0){
qInfo("dead End reached");
while (hist.size()>1)
{
hist.back()->un();
hist.pop_back();
}
return;
//solveButtonClicked();
}
int choiceCell = rand() % b.size(); //choose a random cell
int choiceNr = rand() % b[choiceCell]->index.size(); //choose a random number;
b[choiceCell]->collapse(b[choiceCell]->index[choiceNr]); //collapse that random cell with chosen number;
hist.push_back(b[choiceCell]);
repaint(); //draw cells again
QThread::msleep(m_delay);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment