void CMonitorProcesses::slotLoad() { // only bother with this if we are visible... if ( !isVisible() ) return; if ( !bEnabled ) return; // init coms with DM but don't even bother the DM until (if) we become visible... if ( !hStats ) { if ( uodbc_open_stats( &hStats, UODBC_STATS_READ ) != 0 ) { // char szError[512]; // QMessageBox::critical( this, tr( "Monitor Processes" ), QString( "uodbc_open_stats failed\n%1" ).arg( uodbc_stats_error( szError, 512 ) ) ); // bEnabled = false; return; } } // get current processes info... { uodbc_stats_retentry aPIDs[MAXPROCESSES]; int nPIDs = uodbc_get_stats( hStats, 0, aPIDs, MAXPROCESSES ); for ( int nPID = 0; nPID < MAXPROCESSES; nPID++ ) { if ( nPID < nPIDs ) { // get handle count for current process... uodbc_stats_retentry aHandles[MAXHANDLES]; int nHandles = uodbc_get_stats( hStats, aPIDs[nPID].value.l_value, aHandles, MAXHANDLES ); if ( nHandles > 0 ) { item( nPID, 0 )->setText( QString( "%1" ).arg( aPIDs[nPID].value.l_value ) ); for ( int nHandle = 0; nHandle < MAXHANDLES; nHandle++ ) { item( nPID, nHandle + 1 )->setText( QString( "%1" ).arg( aHandles[nHandle].value.l_value ) ); } } else clearRow( nPID ); } else { // no need to clear remaining rows if no data in them... if ( nPID >= nRowsWithValues ) { nRowsWithValues = nPID; return; } clearRow( nPID ); } } } }
/** * \en * clears all tags from pattern * \_en * \ru * Удаляет все теги из документа, а также строки, в которых содержится тег секции * \_ru */ void aMSOTemplate::cleanUpTags() { QDomNode n = docTpl.lastChild(); while( !n.isNull() ) { clearTags(n,false); //clearRow(n); n = n.previousSibling(); } n = docTpl.lastChild(); while( !n.isNull() ) { //clearTags(n,false); clearRow(n); n = n.previousSibling(); } n = docTpl.lastChild(); while (!n.isNull()) { clearAttributes(n, "Table", "ss:ExpandedRowCount"); n = n.previousSibling(); } }
void MainWindow::addRow(QList<detail> d) { clearRow(); int detailsSize = d.size(); // qDebug()<<"get details size is "<<detailsSize; if(detailsSize>=0) { ui->tableWidget->setRowCount(detailsSize); int i = 0; for(;i<detailsSize;i++){ detail m_detail = d.at(i); // qDebug()<<"addRow "<<i<<m_detail.id<<m_detail.classID<<m_detail.date<<m_detail.number<<m_detail.summary<<m_detail.income<<m_detail.lend_long<<m_detail.lend_sort<<m_detail.loss<<m_detail.lost<<m_detail.total; // ui->tableWidget->setItem(0,0,new QTableWidgetItem("2222")); ui->tableWidget->setItem(i,0,new QTableWidgetItem(QString::number(m_detail.id))); ui->tableWidget->setItem(i,1,new QTableWidgetItem(QString(m_detail.date))); ui->tableWidget->setItem(i,2,new QTableWidgetItem(QString(m_detail.number))); ui->tableWidget->setItem(i,3,new QTableWidgetItem(QString(m_detail.summary))); ui->tableWidget->setItem(i,4,new QTableWidgetItem(QString::number(m_detail.income,10))); ui->tableWidget->setItem(i,5,new QTableWidgetItem(QString::number(m_detail.lend_long),10)); ui->tableWidget->setItem(i,6,new QTableWidgetItem(QString::number(m_detail.lend_sort,10))); ui->tableWidget->setItem(i,7,new QTableWidgetItem(QString::number(m_detail.loss,10))); ui->tableWidget->setItem(i,8,new QTableWidgetItem(QString::number(m_detail.lost,10))); ui->tableWidget->setItem(i,9,new QTableWidgetItem(QString::number(m_detail.t_lend_long,10))); ui->tableWidget->setItem(i,10,new QTableWidgetItem(QString::number(m_detail.t_lend_sort,10))); ui->tableWidget->setItem(i,11,new QTableWidgetItem(QString::number(m_detail.t_new,10))); ui->tableWidget->setItem(i,12,new QTableWidgetItem(QString::number(m_detail.t_old,10))); ui->tableWidget->setItem(i,13,new QTableWidgetItem(QString::number(m_detail.t_total,10))); ui->tableWidget->setItem(i,14,new QTableWidgetItem(QString::number(m_detail.total,10))); // ui->tableWidget->setItem(0,9,new QTableWidgetItem(d.date)); } } ui->tableWidget->resizeColumnsToContents(); this->resetWindowsSize(); setCulReadOnlay(); }
void Terminal::clearAll() { _cursorX = 0; _cursorY = 0; BBS::CellAttribute a; a.f.fColorIndex = BBS::ColorIndexForeground; a.f.bColorIndex = BBS::ColorIndexBackground; a.f.bright = 0; a.f.underlined = 0; a.f.blinking = 0; a.f.reversed = 0; a.f.isUrl = 0; a.f.isNothing = 0; _emptyAttr = a.v; for (int i = 0; i < _row; i++) clearRow(i); _csBuf->clear(); _csArg->clear(); _fColorIndex = a.f.fColorIndex; _bColorIndex = a.f.bColorIndex; _csTemp = 0; _state = StateNormal; _bright = false; _underlined = false; _blinking = false; _reversed = false ^ _screenReverse; }
int main(void) { xplained_init(); fprintf(COMM_LCD, G_NAME); setDate(2013, 1, 15, 11, 32, 50); // 250 ms Timer siehe app3b.c ~ 0,09% Fehler // Top Wert TCC0.PER = 32031; // Prescaler TCC0.CTRLA = TC_CLKSEL_DIV256_gc; mcu_enable_interrupt(); while (1) { if (update) { clearRow(LCD_ROW1); fprintf(COMM_LCD, "%.2i:%.2i:%.2i", hour, min, s); //Ganz komischer Fehler mit clearRow(LCD_ROW2), irgendwie wird LCD_ROW0 zum teil überschrieben, deshalb so: st7036_goto(LCD_ROW2, 0); fprintf(COMM_LCD, " "); st7036_goto(LCD_ROW2, 0); fprintf(COMM_LCD, "%i.%i.%i", day, month, year); update = false; } } return 0; }
void checkForTileRows() { bool columnsClear[10]; bool rowsClear[10]; int z; for (z = 0; z < 10; z++) { checkColumn(z); columnsClear[z] = lastClearCheck; } for (z = 0; z < 10; z++) { checkRow(z); rowsClear[z] = lastClearCheck; } for (z = 0; z < 10; z++) { if (columnsClear[z]) { clearColumn(z); } } for (z = 0; z < 10; z++) { if (rowsClear[z]) { clearRow(z); } } }
/** * \en * Deletes row, having section tag * \_en * \ru * Рекурсивная функция. Удаляет строки, содержащие тег секции * \_ru * \param node - \en context \_en \ru узел из которого нужно удалить строки \_ru */ void aMSOTemplate::clearRow(QDomNode node) { QDomNode n = node.lastChild(); while( !n.isNull() ) { if(n.isText()) { QString str = n.nodeValue(); QRegExp re; re.setPattern(QString("%1.*%2").arg(open_token_section).arg(close_token_section)); re.setMinimal(true); int pos = re.search(str,0); if(pos!=-1) { QDomNode tmp = n; while(!tmp.parentNode().isNull()) { tmp = tmp.parentNode(); if( tmp.nodeName()=="Row" ) { tmp.parentNode().removeChild(tmp); break; } } } } else { clearRow(n); } n = n.previousSibling(); } }
void SequenceDisplayer::clearWidgets(bool deleteLabels) { std::map<int, sequenceData>::iterator it; for (it = activeSequencesIdToDataMap.begin(); it != activeSequencesIdToDataMap.end(); it++) { sequenceData seq = it->second; clearRow(seq, deleteLabels); } }
void PreAgiEngine::clearTextArea() { int start = IDI_MAX_ROW_PIC; if (getGameID() == GID_TROLL) start = 21; for (int row = start; row < 200 / 8; row++) { clearRow(row); } }
void DataGrid::onCellChange(wxGridEvent &event) { long money = 0, moneyI = 0, moneyO = 0; int row = event.GetRow(); int col = event.GetCol(); struct item *it = dataPosFromRow(row); wxString text; if (m_data == NULL || row == 0) return; if (!(text = GetCellValue(row, IncomeIndex)).IsEmpty()) { moneyI = -str_to_money(text); } if (!(text = GetCellValue(row, OutlayIndex)).IsEmpty()) { moneyO = str_to_money(text); } if (moneyI != 0 && moneyO != 0) { wxMessageBox(HaStrings::errDupMoney, HaStrings::appName, wxOK | wxICON_ERROR); if (col == IncomeIndex) { money = moneyI; SetCellValue(row, OutlayIndex, wxT("")); } else if (col == OutlayIndex) { money = moneyO; SetCellValue(row, IncomeIndex, wxT("")); } } else if (moneyI != 0) { money = moneyI; SetCellValue(row, OutlayIndex, wxT("")); } else { money = moneyO; SetCellValue(row, IncomeIndex, wxT("")); } wxString desc = GetCellValue(row, DescIndex); desc.Trim(true).Trim(false); wxString comment = GetCellValue(row, CommentIndex); comment.Trim(true).Trim(false); struct string s_desc, s_comment; string_fill_slice(&s_desc, desc, '\0'); string_fill_slice(&s_comment, comment, '\0'); if (item_set(it, money, &s_desc, &s_comment) == NULL) throw std::bad_alloc(); m_data->setModified(); if (col == IncomeIndex || col == OutlayIndex) { updateBalanceAndTotal(); } if (is_dummy_item(it)) clearRow(row); wxCommandEvent ev(wxEVT_RESIZE_COL, GetId()); ev.SetEventObject(this); ev.SetInt(col); wxPostEvent(this, ev); }
void DataGrid::setRow(int row) { SetCellAlignment(wxALIGN_RIGHT, row, IncomeIndex); SetCellAlignment(wxALIGN_RIGHT, row, OutlayIndex); SetCellAlignment(wxALIGN_RIGHT, row, BalanceIndex); SetReadOnly(row, IncomeIndex, false); SetReadOnly(row, OutlayIndex, false); SetReadOnly(row, DescIndex, false); SetReadOnly(row, CommentIndex, false); SetReadOnly(row, BalanceIndex); SetCellEditor(row, IncomeIndex, new wxGridCellFloatEditor(MONEY_LEN, 2)); SetCellEditor(row, OutlayIndex, new wxGridCellFloatEditor(MONEY_LEN, 2)); clearRow(row); for (int i = 0; i < ColumnNum; i++) { SetCellFont(row, i, GetDefaultCellFont()); SetCellTextColour(row, i, GetDefaultCellTextColour()); } }
void DataGrid::showMainData() { char buf[MONEY_LEN]; BeginBatch(); int diff = GetNumberRows()-(m_data->getItemsNum()+1+1); // +initial and total if (diff < 0) { if (!AppendRows(-diff)) return; setRows(m_data->getItemsNum()+1+diff, -diff); } else if (diff > 0) { if (!DeleteRows(m_data->getItemsNum()+1, diff)) return; } SetRowLabelValue(0, HaStrings::strInitial); money_to_str_trail(buf, m_data->getInitial()); SetCellValue(0, BalanceIndex, buf); int row = 1; for (DataFileRW::ItemIterator i = m_data->ItemBegin(); i != m_data->ItemEnd(); ++i, row++) { if (ulist_is_first(&i->owner->items, &i->ulist)) { SetRowLabelValue(row, i->owner->title.str); } else { SetRowLabelValue(row, wxT("")); } clearRow(row); if (is_dummy_item(&*i)) continue; if (i->money < 0) { money_to_str_trail(buf, -i->money); SetCellValue(row, IncomeIndex, buf); } else { money_to_str_trail(buf, i->money); SetCellValue(row, OutlayIndex, buf); } SetCellValue(row, DescIndex, i->desc.str); SetCellValue(row, CommentIndex, i->comment.str); } SetRowLabelValue(row, HaStrings::strTotal); for (int i = 0; i < ColumnNum; i++) SetReadOnly(row, i); wxFont font = GetCellFont(row, 0); font.MakeBold(); SetCellFont(row, IncomeIndex, font); SetCellFont(row, OutlayIndex, font); EndBatch(); }
int solveNQueensUtil(int* b,int i) { int k=generateRandomNum(); // printf("fe %d\n",i); int j=k; do { if(isSafe(b,i,j)==1 && *(b+8*4*i+j)!=1) { // printf("entering value at (%d,%d)\n",i,j); // printf(" value at (0,6) is %d\n",*(b+8*4*0+6)); clearRow(b,i); *(b+8*4*i+j)=1; if(i==7) return 1; else return solveNQueensUtil(b,i+1); } else if(*(b+8*4*i+j)==1 && isSafe(b,i,j)==0) { *(b+8*4*i+j)=0; j++; if(j==8) j=0; } else { j++; if(j==8) j=0; } // j++; }while(j!=k); if(i>0) return solveNQueensUtil(b,i-1); return 0; }
/*! \internal Both solveMin and solveMax are interfaces to this method. The enum solverFactor admits 2 values: Minimum (-1) and Maximum (+1). This method sets the original objective and runs the second phase Simplex to obtain the optimal solution for the problem. As the internal simplex solver is only able to _maximize_ objectives, we handle the minimization case by inverting the original objective and then maximizing it. */ qreal QSimplex::solver(solverFactor factor) { // Remove old objective clearRow(0); // Set new objective in the first row of the simplex matrix qreal resultOffset = 0; QHash<QSimplexVariable *, qreal>::const_iterator iter; for (iter = objective->variables.constBegin(); iter != objective->variables.constEnd(); ++iter) { // Check if the variable was removed in the simplification process. // If so, we save its offset to the objective function and skip adding // it to the matrix. if (iter.key()->index == -1) { resultOffset += iter.value() * iter.key()->result; continue; } setValueAt(0, iter.key()->index, -1 * factor * iter.value()); } solveMaxHelper(); collectResults(); #ifdef QT_DEBUG for (int i = 0; i < constraints.size(); ++i) { Q_ASSERT(constraints[i]->isSatisfied()); } #endif // Return the value calculated by the simplex plus the value of the // fixed variables. return (factor * valueAt(0, columns - 1)) + resultOffset; }
void setZeroes(vector<vector<int>>& matrix) { int row = matrix.size(); int col = matrix[0].size(); vector<bool> clearRow(row),clearCol(col); for (int i = 0; i < row; ++i) { for (int j = 0; j < col; ++j) { if(!matrix[i][j]) { clearRow[i] = true; clearCol[j] = true; } } } for (int i = 0; i < row; ++i) { for(int j = 0; j < col; ++j) { if(clearRow[i] || clearCol[j]) matrix[i][j] = 0; } } }
// column course col_course->HeaderText = L"Course"; col_course->Name = L"course"; col_course->AutoSizeMode = System::Windows::Forms::DataGridViewAutoSizeColumnMode::Fill; // columns app columns = gcnew array<System::Windows::Forms::DataGridViewTextBoxColumn^> (2); columns[0] = col_studentId; columns[1] = col_course; // dataGrid data_grid = dataGrid; colDelegate = gcnew addCols(this, &Worker::addColsMethod); rowDelegate = gcnew addRow(this, &Worker::addRowMethod); clearDelegate = gcnew clearRow(this, &Worker::clearRowMethod); data_grid->Invoke(colDelegate, data_grid, columns); data_grid->Invoke(clearDelegate, data_grid); // excluded lists excluded = gcnew array<String^> {"MATH010", "MATH003", "MATH115", "MATH116", "MATH143", "MATH144", "MATH133", "MATH134"}; // input files this->file_audit = audit; this->file_master = master; // database queries this->dbQuery = (gcnew SQLiteCommand()); this->dbQuery->CommandText = nullptr;
ADBRow::~ADBRow() { clearRow(); }
/*========================================================================== evaluateSieve: Function: searches sieve for relations and sticks them into a matrix, then sticks their X and Y values into two arrays XArr and YArr ===========================================================================*/ static void evaluateSieve( unsigned long numPrimes, unsigned long Mdiv2, unsigned long * relations, unsigned long ctimesreps, unsigned long M, unsigned char * sieve, mpz_t A, mpz_t B, mpz_t C, unsigned long * soln1, unsigned long * soln2, unsigned char * flags, matrix_t m, mpz_t * XArr, unsigned long * aind, int min, int s, int * exponents, unsigned long * npartials, unsigned long * nrelsfound, unsigned long * nrelssought, mpz_t temp, mpz_t temp2, mpz_t temp3, mpz_t res) { long i,j,ii; unsigned int k; unsigned int exponent, vv; unsigned char extra; unsigned int modp; unsigned long * sieve2; unsigned char bits; int numfactors; unsigned long relsFound = *nrelsfound; unsigned long relSought = *nrelssought; mpz_set_ui(temp, 0); mpz_set_ui(temp2, 0); mpz_set_ui(temp3, 0); mpz_set_ui(res, 0); i = 0; j = 0; sieve2 = (unsigned long *) sieve; #ifdef POLS gmp_printf("%Zdx^2%+Zdx\n%+Zd\n",A,B,C); #endif while ( (unsigned long)j < M/sizeof(unsigned long)) { do { while (!(sieve2[j] & SIEVEMASK)) j++; i = j * sizeof(unsigned long); j++; while (((unsigned long)i < j*sizeof(unsigned long)) && (sieve[i] < threshold)) i++; } while (sieve[i] < threshold); if (((unsigned long)i<M) && (relsFound < relSought)) { mpz_set_ui(temp,i+ctimesreps); mpz_sub_ui(temp, temp, Mdiv2); /* X */ mpz_set(temp3, B); /* B */ mpz_addmul(temp3, A, temp); /* AX+B */ mpz_add(temp2, temp3, B); /* AX+2B */ mpz_mul(temp2, temp2, temp); /* AX^2+2BX */ mpz_add(res, temp2, C); /* AX^2+2BX+C */ bits = mpz_sizeinbase(res,2) - errorbits; numfactors=0; extra = 0; memset(exponents, 0, firstprime * sizeof(int)); if (factorBase[0] != 1 && mpz_divisible_ui_p(res, factorBase[0])) { extra += primeSizes[0]; if (factorBase[0] == 2) { exponent = mpz_scan1(res, 0); mpz_tdiv_q_2exp(res, res, exponent); } else { mpz_set_ui(temp,factorBase[0]); exponent = mpz_remove(res,res,temp); } exponents[0] = exponent; } exponents[1] = 0; if (mpz_divisible_ui_p(res, factorBase[1])) { extra += primeSizes[1]; if (factorBase[1] == 2) { exponent = mpz_scan1(res, 0); mpz_tdiv_q_2exp(res, res, exponent); } else { mpz_set_ui(temp,factorBase[1]); exponent = mpz_remove(res,res,temp); } exponents[1] = exponent; } for (k = 2; k < firstprime; k++) { modp=(i+ctimesreps)%factorBase[k]; exponents[k] = 0; if (soln2[k] != (unsigned long)-1) { if ((modp==soln1[k]) || (modp==soln2[k])) { extra+=primeSizes[k]; mpz_set_ui(temp,factorBase[k]); exponent = mpz_remove(res,res,temp); CHECK_EXPONENT(exponent, k); PRINT_FB(exponent, k); exponents[k] = exponent; } } else if (mpz_divisible_ui_p(res, factorBase[k])) { extra += primeSizes[k]; mpz_set_ui(temp,factorBase[k]); exponent = mpz_remove(res,res,temp); PRINT_FB(exponent, k); exponents[k] = exponent; } } sieve[i]+=extra; if (sieve[i] >= bits) { vv=((unsigned char)1<<(i&7)); for (k = firstprime; (k<secondprime)&&(extra<sieve[i]); k++) { modp=(i+ctimesreps)%factorBase[k]; if (soln2[k] != (unsigned long)-1) { if ((modp==soln1[k]) || (modp==soln2[k])) { extra+=primeSizes[k]; mpz_set_ui(temp,factorBase[k]); exponent = mpz_remove(res,res,temp); CHECK_EXPONENT(exponent, k); PRINT_FB(exponent, k); if (exponent) for (ii = 0; ii < (long)exponent; ii++) set_relation(relations, relsFound, ++numfactors, k); if (exponent & 1) insertEntry(m,relsFound,k); } } else if (mpz_divisible_ui_p(res, factorBase[k])) { extra += primeSizes[k]; mpz_set_ui(temp,factorBase[k]); exponent = mpz_remove(res,res,temp); PRINT_FB(exponent, k); for (ii = 0; ii < (long)exponent; ii++) set_relation(relations, relsFound, ++numfactors, k); if (exponent & 1) insertEntry(m,relsFound,k); } } for (k = secondprime; (k<numPrimes)&&(extra<sieve[i]); k++) { if (flags[k]&vv) { modp=(i+ctimesreps)%factorBase[k]; if ((modp==soln1[k]) || (modp==soln2[k])) { extra+=primeSizes[k]; mpz_set_ui(temp,factorBase[k]); exponent = mpz_remove(res,res,temp); CHECK_EXPONENT(exponent, k); PRINT_FB(exponent, k); if (exponent) for (ii = 0; ii < (long)exponent; ii++) set_relation(relations, relsFound, ++numfactors, k); if (exponent & 1) insertEntry(m,relsFound,k); } } } for (ii =0; ii<s; ii++) { xorEntry(m,relsFound,aind[ii]+min); set_relation(relations, relsFound, ++numfactors, aind[ii]+min); } if (mpz_cmp_ui(res,1000)>0) { if (mpz_cmp_ui(res,largeprime)<0) { (*npartials)++; } clearRow(m,numPrimes,relsFound); #ifdef RELPRINT gmp_printf(" %Zd\n",res); #endif } else { mpz_neg(res,res); if (mpz_cmp_ui(res,1000)>0) { if (mpz_cmp_ui(res,largeprime)<0) { (*npartials)++; } clearRow(m,numPrimes,relsFound); #ifdef RELPRINT gmp_printf(" %Zd\n",res); #endif } else { #ifdef RELPRINT printf("....R\n"); #endif for (ii = 0; ii < (long)firstprime; ii++) { int jj; for (jj = 0; jj < exponents[ii]; jj++) set_relation(relations, relsFound, ++numfactors, ii); if (exponents[ii] & 1) insertEntry(m,relsFound,ii); } set_relation(relations, relsFound, 0, numfactors); mpz_init_set(XArr[relsFound], temp3); /* (AX+B) */ relsFound++; #ifdef COUNT if (relsFound%20==0) fprintf(stderr,"%lu relations, %lu partials.\n", relsFound, *npartials); #endif } } } else { clearRow(m,numPrimes,relsFound); #ifdef RELPRINT printf("\r \r"); #endif } i++; } else if (relsFound >= relSought) i++; } /* Update caller */ *nrelsfound = relsFound; *nrelssought = relSought; }
int main() { PS2Controller psData; static uint8 c_flag = 0; static uint8 right_flag = 0; static uint8 left_flag = 0; static uint8 down_flag = 0; static uint8 up_flag = 0; uint8 counter = 0; uint8 cmax = 50; int blocks[7][4][4] = { //ブロックの宣言 { {0,0,0,0}, {0,1,1,0}, {0,0,1,0}, {0,0,1,0} }, { {0,0,0,0}, {0,1,1,0}, {0,1,0,0}, {0,1,0,0} }, { {0,0,0,0}, {0,1,0,0}, {0,1,1,0}, {0,0,1,0} }, { {0,0,0,0}, {0,0,1,0}, {0,1,1,0}, {0,1,0,0} }, { {0,0,0,0}, {0,0,1,0}, {0,1,1,0}, {0,0,1,0} }, { {0,0,0,0}, {0,1,1,0}, {0,1,1,0}, {0,0,0,0} }, { {0,0,1,0}, {0,0,1,0}, {0,0,1,0}, {0,0,1,0} } }; int i, j, bflg = 0, gflg = 1; int block[4][4] = {}, rotated[4][4]; signed int slidex = 0, slidey = 0; char string[12] = {}; CyGlobalIntEnable; PS2_Start(); CyIntSetSysVector(SysTick_IRQn + 16, timer_isr); SysTick_Config(0x00ffff); //USBUART_Start(0, USBUART_5V_OPERATION); //while (USBUART_GetConfiguration() == 0); //USBUART_CDC_Init(); DotMat_init(); randomBlock(blocks, block); paintBlock(block[4][4], slidey, slidex); //DotMat_paint(&Map); CyDelay(100); for (;;){ psData = PS2_Controller_get(); dotMatrix_print(&Map); dotMatrix_print(&dotMat); if(isr_flg){ if(gflg){ if(counter == cmax){ if(check(block, slidey - 1, slidex) == 1){ slidey--; } else{ mergeMatrix(block, slidey , slidex); clearRow(&cmax); dotMatrix_dataToArray(&Map); if(slidey == 0){ myprint(string); gflg = 0; } randomBlock(blocks, block); slidey = 0; slidex = 0; } if(gflg){ DotMat_paint(block, slidey, slidex); } counter = 0; } counter++; } else{ myprint(string); } isr_flg = 0; } if(psData.CIRCLE || psData.CROSS){ rand(); if(c_flag){ if(psData.CIRCLE){ rotate(block, rotated, 1); } if(psData.CROSS){ rotate(block, rotated, 2); } if(check(rotated, slidey , slidex) == 1){ if(bflg == 1){ slidex--; bflg = 0; } if(bflg == 2){ slidex++; bflg = 0; } rotate2block(block, rotated); DotMat_paint(block, slidey, slidex); } if(check(rotated, slidey , slidex) == 2){ bflg = 1; if(check(rotated, slidey , slidex + 1) == 2){ if(check(rotated, slidey , slidex + 2) == 1){ slidex++; } } if(check(rotated, slidey , slidex + 1) == 1){ slidex++; rotate2block(block, rotated); DotMat_paint(block, slidey, slidex); } } if(check(rotated, slidey , slidex) == 3){ bflg = 2; if(check(rotated, slidey , slidex - 1) == 3){ if(check(rotated, slidey , slidex - 2) == 1){ slidex--; } } if(check(rotated, slidey , slidex - 1) == 1){ slidex--; rotate2block(block, rotated); DotMat_paint(block, slidey, slidex); } } } c_flag = 0; } else{ c_flag = 1; } if(psData.LEFT){ bflg = 0; rand(); if(left_flag){ if(check(block, slidey , slidex - 1) == 1){ slidex--; DotMat_paint(block, slidey, slidex); } } left_flag = 0; } else{ left_flag = 1; } if(psData.RIGHT){ bflg = 0; rand(); if(right_flag){ if(check(block, slidey , slidex + 1) == 1){ slidex++; DotMat_paint(block, slidey, slidex); } } right_flag = 0; } else{ right_flag = 1; } if(psData.UP){ rand(); if(up_flag){ while(check(block, slidey - 1, slidex) == 1){ slidey--; } DotMat_paint(block, slidey, slidex); } up_flag = 0; } else{ up_flag = 1; } if(psData.DOWN){ rand(); if(psData.L1){ if(psData.R1){ while(check(block, slidey - 1, slidex) == 1){ slidey++; DotMat_paint(block, slidey, slidex); } } } if(down_flag){ while(check(block, slidey - 1, slidex) == 1){ slidey--; DotMat_paint(block, slidey, slidex); } } down_flag = 0; } else{ down_flag = 1; } if(psData.SELECT){ if(psData.START){ slidey = 0; slidex = 0; DotMat_init(); randomBlock(blocks, block); paintBlock(block[4][4], slidey, slidex); gflg = 1; cmax = 50; } } } }