16 lines
496 B
Markdown
16 lines
496 B
Markdown
# poker.js — formatCard() (satır 74)
|
||
|
||
[← poker.js](index.md) · [← Master](../../wiki.md)
|
||
|
||
```javascript
|
||
function formatCard(card) {
|
||
if (!card) return "§7[ - ]";
|
||
var suit = card.charAt(card.length - 1);
|
||
var rank = card.substring(0, card.length - 1);
|
||
var isRed = (suit === "♥" || suit === "♦");
|
||
var cSuit = isRed ? "§c" + suit : "§8" + suit;
|
||
var cRank = isRed ? "§c§l" + rank : "§f§l" + rank;
|
||
return "§f[ " + cRank + " " + cSuit + " §f]";
|
||
}
|
||
```
|