Skip to content

Commit

Permalink
show proper ranks
Browse files Browse the repository at this point in the history
  • Loading branch information
tmwilliamlin168 committed Feb 17, 2021
1 parent c63d34d commit 15e6d46
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions front/pages/game.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface GameState {
playerTurn: string
}

const rankStrs = ['', 'A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K'];
const suitChars = ['♣', '♦', '♥', '♠'];

export default function Game() {
Expand Down Expand Up @@ -118,7 +119,7 @@ export default function Game() {
<p>Last played:</p>
{gameState.lastPlayed ? (
<>
{gameState.lastPlayed.map((card, i) => <span key={i}>{card.rank+' '+suitChars[card.suit]+'|'}</span>)}
{gameState.lastPlayed.map((card, i) => <span key={i}>{rankStrs[card.rank]+' '+suitChars[card.suit]+'|'}</span>)}
{` by ${gameState.lastPlayedPlayer}`}
</>
) : '(Nothing)'}
Expand All @@ -137,7 +138,7 @@ export default function Game() {
setCardSelected(cardSelected2);
}}
/>
{card.rank+' '+suitChars[card.suit]}
{rankStrs[card.rank]+' '+suitChars[card.suit]}
</label>
))}
<button
Expand Down

1 comment on commit 15e6d46

@vercel
Copy link

@vercel vercel bot commented on 15e6d46 Feb 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.