Changed it so that hand is printed horizontally instead of vertically.

This commit is contained in:
Jordan Geurtsen
2022-09-20 22:49:44 +02:00
parent 1420fbda53
commit 0db4ef14f2
2 changed files with 9 additions and 5 deletions

View File

@@ -26,9 +26,8 @@
</build>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

View File

@@ -89,7 +89,12 @@ public class Human extends Player {
List<Card> hand = getHand();
for (int i = 0; i < hand.size(); i++) {
Card card = hand.get(i);
System.out.println("(" + i + ") " + card);
if (i == 0) {
System.out.println("Your hand: ");
System.out.printf("(%s) %s ", i, card);
} else {
System.out.printf("| (%s) %s ", i, card);
}
}
}
}