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

removed loop

parent 503e6f21
Branches
No related tags found
1 merge request!2backtracking
......@@ -42,14 +42,8 @@ Window::Window(QWidget *parent)
dy = 8;
m_cell[x + y * 9].setParent(this);
m_cell[x + y * 9].setGeometry(x * 100 + dx, y * 100 + dy, 100, 100);
/* code */
}
}
// init signals
for (int x = 0; x < 9; x++)
{
for (int y = 0; y < 9; y++)
{
//connecting signals & slots
for (int d = 0; d < 9; d++) // rows and columns
{
connect(&m_cell[x + y * 9], SIGNAL(update(int)), &m_cell[x + d * 9], SLOT(removeOption(int)));
......@@ -77,7 +71,7 @@ void Window::solveButtonClicked()
{
std::list<History *> hist;
bool backtracking = false;
srand(time(NULL));
srand(time(NULL)); //random seed
while (1)
{
if (backtracking)
......@@ -140,11 +134,14 @@ void Window::solveButtonClicked()
// qInfo("%d---:)");
}
void Window::clearButtonClicked(){
for(auto& x: m_cell){
void Window::clearButtonClicked()
{
for (auto &x : m_cell)
{
if (x.collapsed)
x.un();
}
repaint();
return;
}
void Window::setValue(int s)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment