From 36db530a896a3f2e645fcb7fc5396057a3006270 Mon Sep 17 00:00:00 2001 From: mcmlxxix <> Date: Tue, 18 May 2010 17:02:21 +0000 Subject: [PATCH] add colored suits --- exec/load/cardlib.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exec/load/cardlib.js b/exec/load/cardlib.js index f3f621b4e7..b28e5cd051 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() { -- GitLab