diff options
Diffstat (limited to 'examples/tictac/tictac.cpp')
-rw-r--r-- | examples/tictac/tictac.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/tictac/tictac.cpp b/examples/tictac/tictac.cpp index dec6fe33c..593e4557a 100644 --- a/examples/tictac/tictac.cpp +++ b/examples/tictac/tictac.cpp @@ -64,7 +64,7 @@ TicTacGameBoard::TicTacGameBoard( int n, TQWidget *parent, const char *name ) st = Init; // initial state nBoard = n; n *= n; // make square - comp_starts = FALSE; // human starts + comp_starts = false; // human starts buttons = new TicTacButtons(n); // create real buttons btArray = new TicTacArray(n); // create button model TQGridLayout * grid = new TQGridLayout( this, nBoard, nBoard, 4 ); @@ -72,7 +72,7 @@ TicTacGameBoard::TicTacGameBoard( int n, TQWidget *parent, const char *name ) for ( int i=0; i<n; i++ ) { // create and connect buttons TicTacButton *ttb = new TicTacButton( this ); ttb->setPalette( p ); - ttb->setEnabled( FALSE ); + ttb->setEnabled( false ); connect( ttb, TQ_SIGNAL(clicked()), TQ_SLOT(buttonClicked()) ); grid->addWidget( ttb, i%nBoard, i/nBoard ); buttons->insert( i, ttb ); @@ -92,7 +92,7 @@ TicTacGameBoard::~TicTacGameBoard() // -------------------------------------------------------------------------- // TicTacGameBoard::computerStarts( bool v ) // -// Computer starts if v=TRUE. The human starts by default. +// Computer starts if v=true. The human starts by default. // void TicTacGameBoard::computerStarts( bool v ) @@ -178,7 +178,7 @@ int TicTacGameBoard::checkBoard( TicTacArray *a ) { int t = 0; int row, col; - bool won = FALSE; + bool won = false; for ( row=0; row<nBoard && !won; row++ ) { // check horizontal t = a->at(row*nBoard); if ( t == TicTacButton::Blank ) @@ -187,7 +187,7 @@ int TicTacGameBoard::checkBoard( TicTacArray *a ) while ( col<nBoard && a->at(row*nBoard+col) == t ) col++; if ( col == nBoard ) - won = TRUE; + won = true; } for ( col=0; col<nBoard && !won; col++ ) { // check vertical t = a->at(col); @@ -197,7 +197,7 @@ int TicTacGameBoard::checkBoard( TicTacArray *a ) while ( row<nBoard && a->at(row*nBoard+col) == t ) row++; if ( row == nBoard ) - won = TRUE; + won = true; } if ( !won ) { // check diagonal top left t = a->at(0); // to bottom right @@ -206,7 +206,7 @@ int TicTacGameBoard::checkBoard( TicTacArray *a ) while ( i<nBoard && a->at(i*nBoard+i) == t ) i++; if ( i == nBoard ) - won = TRUE; + won = true; } } if ( !won ) { // check diagonal bottom left @@ -219,7 +219,7 @@ int TicTacGameBoard::checkBoard( TicTacArray *a ) i++; j--; } if ( i == nBoard ) - won = TRUE; + won = true; } } if ( !won ) // no winner |