{this.renderSquare(0)}
{this.renderSquare(1)}
@@ -50,15 +90,70 @@ class Board extends Component {
}
}
+function calculateWinner(squares){
+
+ const lines =[
+
+ [0, 1, 2],
+ [3, 4, 5],
+ [6, 7, 8],
+ [0, 3, 6],
+ [1, 4, 7],
+ [2, 5, 8],
+ [0, 4, 8],
+ [2, 4, 6],
+
+ ];
+
+ for (let i =0; i
-
+ this.handleClick(i)}
+ />
-
{/* status */}
+
{ status }
{/* todo */}