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

grenn highlight added

parent 22e2de0a
Branches
No related tags found
No related merge requests found
......@@ -16,11 +16,11 @@ Window::Window(QWidget *parent)
{
m_solveButton = new QPushButton("solve", this);
connect(m_solveButton, SIGNAL(clicked()), this, SLOT(solveButtonClicked()));
m_clearButton = new QPushButton("Clear", this);
m_clearButton = new QPushButton("clear", this);
connect(m_clearButton, SIGNAL(clicked()), this, SLOT(clearButtonClicked()));
m_slider = new QSlider(this);
m_slider->setRange(0, 1000);
m_slider->setRange(0, 5000);
m_slider->setOrientation(Qt::Horizontal);
m_slider->setValue(m_delay);
connect(m_slider, SIGNAL(valueChanged(int)), this, SLOT(setValue(int)));
......@@ -139,7 +139,7 @@ void Window::solveButtonClicked()
c->highlight("#ff0000");
}
repaint(); // draw cells again
delay(m_delay);
delay(m_delay+20000);
for (auto &c : b)
{
c->clearHighlight();
......@@ -160,6 +160,10 @@ void Window::solveButtonClicked()
int choiceCell = rand() % b.size(); // choose a random cell
int choiceNr = rand() % b[choiceCell]->index.size(); // choose a random number;
hist.push_back(History(b[choiceCell], b[choiceCell]->index, choiceNr));
b[choiceCell]->highlight("#00ff00");
repaint(); // draw cells again
delay(m_delay);
b[choiceCell]->clearHighlight();
b[choiceCell]->collapse(b[choiceCell]->index[choiceNr]); // collapse that random cell with chosen number;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment