Skip to content

Commit

Permalink
Created method function to generate random number
Browse files Browse the repository at this point in the history
  • Loading branch information
lucfercas committed Oct 16, 2024
1 parent 3df097b commit 2e36412
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/classes/Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ class Game {
this.players = [];
this.targetNumber = this.generateRandomNumber();
}

generateRandomNumber() {
return Math.floor(Math.random() * 100) + 1;
}
}

0 comments on commit 2e36412

Please sign in to comment.