Skip to content
This repository has been archived by the owner on Feb 19, 2023. It is now read-only.

Commit

Permalink
fix a bug with player names
Browse files Browse the repository at this point in the history
  • Loading branch information
jgao222 committed May 27, 2022
1 parent d512d93 commit 557b37a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/java/battleship/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public Game(GameSettings g) {
// hack way assumes player name input is delineated by spaces and in order
String[] names = g.getSetting("player names").split("\\s+");
int i = 0;
if (names.length != 1 && names[0].isEmpty()) {
if (!(names.length == 1 && names[0].isEmpty())) {
// set the first names.length players to the names given
for (; i < names.length; i++) {
setPlayerName(playerIdList.get(i), names[i]);
Expand Down

0 comments on commit 557b37a

Please sign in to comment.