Programming questions involving digitally-represented playing cards. This includes issues like representing cards and decks in data structures, user interfaces for manipulating cards in a virtual fashion, implementing correct algorithmic shuffling, and using cryptographically secure protocols to exchange cards over a network. Please browse this tag with your target language (e.g. [java] [playing-cards]) to see if your question has been asked before!
Questions tagged [playing-cards]
324 questions
-3
votes
2 answers
Finding Total of ArrayList Objects Java
I need to find the total of some ArrayList objects (playing card values). I have a Card.java class and a User.java class. I have a userHand ArrayList also. I'm not getting any errors but it's not printing the sum. Here is my code:
Card.java
import…

t0xic
- 131
- 1
- 2
- 9
-3
votes
1 answer
Card Matchmaking trouble in Pygames
I have a code for a memory game in pygame. The problem I am trying to resolve is making the cards flip back down once the user selects two cards that are not matching. If any one could help that would be great. Thanks!
import pygame
from…
-3
votes
1 answer
Converting a method to a generic method
I am writing a texas holdem game and created this method to rank the user hand I want to turn it into a generic method so I can pass the dealer hand and then compare the two to see which hand will be better. If you could please help me with…
-4
votes
1 answer
Specific permutations of 32 card deck (in C)
I want to generate all permutations of 32 card deck, I represent cards as numbers 0-7, so I don´t care about color of the card. The game is very simple (divide deck into two gropus, compare two cards, add both cards to group of bigger card). I have…

marcel3032
- 1
- 2
-4
votes
1 answer
How to determine a straight (sequence) in a poker hand in Python
In python I have a score tracker of a poker hand.
Possible card ranks:
A23456789TJQK
Straights of 3 or more cards score 1 per card. Example straight of 4 cards gives you 4 points.
So I have a score:
score = 0
A sorted list of strings (so I don't…

Coder117
- 801
- 2
- 9
- 22
-4
votes
1 answer
Only Half of a Deck of Cards Being Created
I'm trying to create BlackJack for a final project. Here is my current code:
public class Card
{
private string face;
private string suit;
public Card(string cardFace, string cardSuit)
{
face = cardFace;
suit =…

user3384679
- 9
- 2
-4
votes
1 answer
Creating a Deck of Cards
I'm can't seem to figure out how to create this simple deck of cards. If somebody could please show an example of what would go into the "your code goes here" section, it would be very helpful.
By entering suitable code in place of the comment in…

HitmarCurse
- 1
- 2
-4
votes
2 answers
C Program Switch and If statement
So i am trying to create a C code program that will be given the shorthand notation for a playing card and will determine the formatted playing card. Example
Input: H 8
Output: 8 of Hearts
Input: C 14
Output: Ace of…

user3278092
- 1
- 2
-7
votes
2 answers
Create a class for a "WAR" Card game when I have a driver class ready
The directions for the assignment are: Program a game of War. In War, if the value of your card is greater than your opponent's card, you earn one point. If your opponent's card is greater than your card, your opponent gets a point. If you tie it is…

Bryan
- 1
- 1