librejack

Blackjack clone written in java
git clone https://github.com/michaelneuper/librejack.git
README | Files | Log | Refs | LICENSE

commit d435156b115c0822821733c7f74f9a541c86c0ce
parent 6a1d1a835852e116443d0f925a850208d95f4831
Author: Michael Neuper <73108749+michaelneuper@users.noreply.github.com>
Date:   Mon, 10 Oct 2022 18:43:39 +0200

update Person.java

Diffstat:
Msrc/model/Person.java | 9+++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/model/Person.java b/src/model/Person.java @@ -49,8 +49,9 @@ public abstract class Person { /** * Prints a formatted version of the person's hand */ - public void printHand() { - System.out.println(this.name + "'s hand:\n" + this.hand + "[" + this.hand.calculateValue() + "]"); + public String printHand() { +// System.out.println(this.name + "'s hand:\n" + this.hand + "[" + this.hand.calculateValue() + "]"); + return this.name + "'s hand:\n" + this.hand + "[" + this.hand.calculateValue() + "]"; } /** @@ -61,13 +62,13 @@ public abstract class Person { */ public void hit(Deck deck, Deck discard) { - // if there's no cards left in the deck + // if there are no cards left in the deck if (!deck.hasCards()) { deck.reloadDeckFromDiscard(discard); } this.hand.takeCardFromDeck(deck); - System.out.println(this.name + " gets a card"); +// System.out.println(this.name + " gets a card"); this.printHand(); }