Board.cpp
//Should be two parts, Letter and Num: B5.
Should be two parts, Letter and Num: B5.
Should be two parts Letter and Num : B5 .
int Board::getColumn(std::string coords){
	int width; std::string letter_width;
	if( coords[0] >= 64 ){
		letter_width = coords[0];
	} else if( coords[1] >= 64){
		letter_width = coords[1];
	}
	if(letter_width[0] >= 97)
		width = (int)letter_width[0]-97;
	else if (letter_width[0] > 65)
		width = (int)letter_width[0]-65;
	else return -1; 
	return width;  
}
int Board :: getColumn ( std :: string coords ) { int width ; std :: string letter_width ; if ( coords [ 0 ] >= 64 ) { letter_width = coords [ 0 ] ; } else if ( coords [ 1 ] >= 64 ) { letter_width = coords [ 1 ] ; } if ( letter_width [ 0 ] >= 97 ) width = ( int ) letter_width [ 0 ] - 97 ; else if ( letter_width [ 0 ] > 65 ) width = ( int ) letter_width [ 0 ] - 65 ; else return -1 ; return width ; }
Should be two parts, Letter and Num: B5.
Should be two parts Letter and Num : B5 .
//Gets the letter value of the given width. //Subtracts ascii values to get their 1-8 values //returns a nasty if not ascii char //Depreciated. /*switch (letter_width[0]){
		case 'A': case 'a':	width = 0; break;
		case 'B': case 'b':	width = 1; break;
		case 'C': case 'c':	width = 2; break;
		case 'D': case 'd':	width = 3; break;
		case 'E': case 'e':	width = 4; break;
		case 'F': case 'f':	width = 5; break;
		case 'G': case 'g':	width = 6; break;
		case 'H': case 'h':	width = 7; break;
	} */