diff --git a/exec/load/cardlib.js b/exec/load/cardlib.js index f3f621b4e7924adf6d842be9fc0959415a7a71b0..b28e5cd0515c51584be8260690f35ac70a5b5398 100644 --- a/exec/load/cardlib.js +++ b/exec/load/cardlib.js @@ -63,7 +63,11 @@ const RANKS = new Array("high card", "pair", "two pair", "three of a kind", function Card(value, suit) { this.value = value; this.suit = suit; + this.color = ""; this.char = VALUE_CHAR[value] + SUIT_CHAR[suit]; + + if(suit==HEARTS || suit==DIAMONDS) this.color=String.fromCharCode(3)+"5"; + else if(suit==SPADES || suit==CLUBS) this.color=String.fromCharCode(3)+"1"; } function Deck() {