Skip to content
Snippets Groups Projects
Commit 36db530a authored by mcmlxxix's avatar mcmlxxix
Browse files

add colored suits

parent bfc4ba58
No related branches found
No related tags found
No related merge requests found
......@@ -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() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment