Skip to content

Commit

Permalink
Merge pull request #32 from Identity-labs/rewriteDistributeMoney
Browse files Browse the repository at this point in the history
Rewrite distribute money
  • Loading branch information
ptwu authored Jul 12, 2020
2 parents f660394 + daf1b92 commit 1e63b46
Show file tree
Hide file tree
Showing 4 changed files with 316 additions and 345 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 1e63b46

Please sign in to comment.