Skip to content

Commit

Permalink
Merge pull request #33 from ptwu/all-in-issue-no-random
Browse files Browse the repository at this point in the history
Merge all in / distributeMoney changes to master
  • Loading branch information
ptwu authored Jul 12, 2020
2 parents e04354d + 1e63b46 commit 1aa8ce7
Show file tree
Hide file tree
Showing 4 changed files with 580 additions and 302 deletions.
2 changes: 1 addition & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ io.on('connection', (socket) => {
let code;
do {
code = "" + Math.floor(Math.random() * 10) + Math.floor(Math.random() * 10) + Math.floor(Math.random() * 10) + Math.floor(Math.random() * 10);
} while (rooms.length != 0 && (rooms.some(r => r.getCode == code)));
} while (rooms.length != 0 && (rooms.some(r => r.getCode() === code)));
const game = new Game(code, data.username);
rooms.push(game);
game.addPlayer(data.username, socket);
Expand Down
Loading

0 comments on commit 1aa8ce7

Please sign in to comment.