Changed it so that hand is printed horizontally instead of vertically.
This commit is contained in:
7
pom.xml
7
pom.xml
@@ -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>
|
||||
</project>
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user