Public feed #894455

Something

public cpp v1 · immutable
Raw Edit
·published 2008-02-06 23:31 UTC
rendered paste body
for(int i=0;i<9;i++){		for(int j=0;j<9;j++)	{		connect(&mat1[i][j], SIGNAL(textChanged()),this , SLOT(TheSignal(i,j)));			}}void Worms::TheSignal(int i,int j){qApp->beep();VerifChiffre(i,j);//VerifLigne();verifColonne(i,j);}void Worms::VerifChiffre(int i, int j){ bool ok;				QString str = mat1[i][j].toPlainText ();						if(str.toInt(&ok, 10)>9 )			{					mat1[i][j].clear();			}			if(!str.isEmpty ())			{			if(str.toInt(&ok, 10)==0 )			{			mat1[i][j].clear();			}			}					}void Worms::verifColonne(int i, int j)         {                bool trouve, ok;                 int val, k;                          trouve = false;                 val = mat1[i][j].toPlainText().toInt(&ok, 10);                 k=0;                 while (k<=9 && !trouve)                {                        if (!mat1[i][j].toPlainText().isEmpty() && k!=j)                                trouve = (mat1[i][k].toPlainText().toInt(&ok, 10) == val);                                               k++;                }                         if (trouve == true)                        colorier(i,j);        }