Skip to content

Commit

Permalink
Randomize the first player to play
Browse files Browse the repository at this point in the history
Changing the Player constructor code to randomize the first player to play at each game.
  • Loading branch information
iagocalazans committed Nov 26, 2019
1 parent 09cd189 commit 51e9b09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Player {

constructor() {
if (this.last == 0) {
this.turn = this.p1;
this.turn = ((Math.random()*1)+1).toFixed(0);
}
}

Expand Down

0 comments on commit 51e9b09

Please sign in to comment.