Skip to content

Commit

Permalink
Chime's Commit #10
Browse files Browse the repository at this point in the history
- Hopefully added a fix to the ready queue in index.html
- Added more values in the PlayerType to have the option to have more than 2 players
  • Loading branch information
Chime-txt committed Apr 30, 2024
1 parent 1ec082b commit 55f88af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ <h2> Player 2 Name</h2>
function readyqueue() {
var playerDoesExist = 0;
const playerName = document.getElementById("playerName").value.trim(); // Get the player's name from the input field
for(i = 0; i < playerNames.length; i++) {
for(i = 0; i <= playerNames.length; i++) {
if ((playerName!=playerNames[i]) && (i == playerNames.length)) {
const playerQueue = document.getElementById('playerQueue');
const li = document.createElement('li');
Expand All @@ -364,6 +364,7 @@ <h2> Player 2 Name</h2>
break;
} else if (playerName==playerNames[i]) {
console.error('Player name already in the ready queue.');
playerDoesExist = 1;
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/uta/cse3310/PlayerType.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
// A player can be an X or an O

public enum PlayerType {
NOPLAYER, XPLAYER, OPLAYER
NOPLAYER, XPLAYER, OPLAYER, PLAYER1, PLAYER2, PLAYER3, PLAYER4
}

0 comments on commit 55f88af

Please sign in to comment.