Piezas.cpp
/**
 * Places a piece of the current turn on the board, returns what
 * piece is placed, and toggles which Piece's turn it is. dropPiece does 
 * NOT allow to place a piece in a location where a column is full.
 * In that case, placePiece returns Piece Blank value 
 * Out of bounds coordinates return the Piece Invalid value
 * Trying to drop a piece where it cannot be placed loses the player's turn
 **/
Places a piece of the current turn on the board, returns what
piece is placed, and toggles which Piece's turn it is. dropPiece does
NOT allow to place a piece in a location where a column is full.
In that case, placePiece returns Piece Blank value
Out of bounds coordinates return the Piece Invalid value
Trying to drop a piece where it cannot be placed loses the player's turn
Places a piece of the current turn on the board returns what piece is placed and toggles which Piece ' s turn it is . dropPiece does NOT allow to place a piece in a location where a column is full . In that case placePiece returns Piece Blank value Out of bounds coordinates return the Piece Invalid value Trying to drop a piece where it cannot be placed loses the player ' s turn
Piece Piezas::dropPiece(int column)
{
	if(column >3 || column <0)
	{
		if(turn == X)
			turn = O;
		else
			turn = X;
		return Invalid;
	}
	for(int i= 0; i <3; ++i)
	{
		if(board[i][column] == Blank)
		{
			Piece save = turn;
			board[i][column] = turn;
			if(turn == X)
				turn = O;
			else
				turn = X;
			return save;
		}
	}
	if(turn == X)
		turn = O;
	else
		turn = X;
	return Blank;
}
Piece Piezas :: dropPiece ( int column ) { if ( column > 3 || column < 0 ) { if ( turn == X ) turn = O ; else turn = X ; return Invalid ; } for ( int i = 0 ; i < 3 ; ++ i ) { if ( board [ i ] [ column ] == Blank ) { Piece save = turn ; board [ i ] [ column ] = turn ; if ( turn == X ) turn = O ; else turn = X ; return save ; } } if ( turn == X ) turn = O ; else turn = X ; return Blank ; }
Places a piece of the current turn on the board, returns what
 piece is placed, and toggles which Piece's turn it is.
Places a piece of the current turn on the board returns what piece is placed and toggles which Piece ' s turn it is .