{this.renderSquare(i)}
{this.renderSquare(i + 1)}
{this.renderSquare(i + 2)}
{this.renderSquare(i + 3)}
{this.renderSquare(i + 4)}
{this.renderSquare(i + 5)}
{this.renderSquare(i + 6)}
{this.renderSquare(i + 7)}
);
}
render() {
let checkMsg = this.whoInCheck() ? "Check! " : "";
let isCheckmate = this.checkmate();
var namedPlayer = isCheckmate ?
!this.state.blackIsNext : this.state.blackIsNext
let color = namedPlayer ? 'Black' : 'White';
const status = isCheckmate ? "Checkmate! " + color + " Wins!" :
checkMsg + color + "'s Turn";
var texttext =
{status}
{this.row(0)}
{this.row(1)}
{this.row(2)}
{this.row(3)}
{this.row(4)}
{this.row(5)}
{this.row(6)}
{this.row(7)}
;
return (
texttext
);
}
}
class Game extends React.Component {
render() {
return (