The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [playing-cards]

Programming questions involving digitally-represented playing cards. This includes representing cards and decks in data structures, user interfaces for manipulating cards in a virtual fashion, and implementing correct algorithmic shuffling.

Filter by
Sorted by
Tagged with
8
votes
4answers
18k views

C++ Blackjack game

I made this small Blackjack game in the past as a way to practice C++ basics and have fun at the same time. I stopped working on the game during the last two years of my computer science degree ...
4
votes
3answers
444 views

Dealing Poker Hands

I thought I'd give a shot at creating my own version of dealing 5-card hands to n players in VBA, printing them to columns and coloring hearts and diamonds red. I felt I might have been a little ...
3
votes
2answers
85 views

Small Poker program rewrite

I had already put up code for review a small poker program but I have rewrote it utilizing a more appropriate data structure. How would I compare Poker hands accordingly? Full source repo ...
5
votes
2answers
2k views

Creating a simple 52-card data structure for Blackjack in Python

I am fairly new to Python so I am trying to learn more about its conventions and ways to make my codes more efficient. I am making a Blackjack game and so far have this class that draws, organizes, ...
1
vote
1answer
446 views

Project Euler 54: Winning Poker Hand

The problem can be found here. The file, poker.txt, contains one-thousand random hands dealt to two players. Each line of the file contains ten cards (separated by a single space): the first ...
8
votes
7answers
10k views

C# Card Shuffle

So, I took a stab at the ole C# Card Shuffle. I wanted to create my own genuine solution rather than copy someone else's. Any advice? ...
3
votes
2answers
5k views

War card game using classes

I would like some feedback to the code I wrote for the card game War. While programming it, I wanted to make classes that I could easily use for other card games too (hence why some functions are ...
8
votes
2answers
408 views

Card-fighting game Part 2

This is part 2 of the game I am building. After some good feedback on my first post I decided it was time to post my updated code. The differences in this part are: Updated code after feedback, new ...
10
votes
1answer
762 views

Card-fighting game

I am currently building my first game/app in javascript. It is a very simple script that has about 130~ lines of code. I feel like what I did so far is not optimized, can anyone please help me ...
4
votes
1answer
468 views

JavaScript Blackjack

I am currently learning JavaScript and the project I have been working on is creating a basic Blackjack game. Some code was provided for me, with the additional instructions: "How would you edit the ...
4
votes
2answers
4k views

Poker Hands in Python

Project Euler problem 54 asks: The file, poker.txt, contains one-thousand random hands dealt to two players. Each line of the file contains ten cards (separated by a single space): the first five ...
6
votes
4answers
5k views

Deck of cards design

Can someone please review this design I created for deck of cards in Java? ...
5
votes
1answer
831 views

Small Poker program in C

I made a small Poker program with C but I believe I could've written it better. Full source on bitbucket.org ...
5
votes
1answer
479 views

BlackJack in Angular

I wrote the following code in Angular as to accomplish a technical test for a UK job. My impression was that it is very neat and well object oriented. To my big surprise, they rejected it. Could ...
4
votes
3answers
7k views

Implementation of a Card class in Java

I have just coded a Card class which gives a suit, rank and a color to a card. However, I have serious doubts that my code is not well organized and not well ...
3
votes
1answer
1k views

Texas Hold'em classes

I am working on a simple Texas Hold'Em dealing simulator. I am new to Python and was hoping to get some advice on my use of classes here. I feel like I am not using them as efficiently as possible, ...
5
votes
2answers
170 views

Determine playing card

I would like a code review on the coding I did for my assignment. The reason I have asked here is because my lecturer has no intention of going through (Don't ask me why, I asked before and he said no....
1
vote
3answers
3k views

Distributing cards to players in C++

I have written this program to deal 7 cards to one player. ...
2
votes
2answers
5k views

Blackjack game program

I'm learning C and decided to write my first major project in C. I was bored and wanted to play blackjack so I decided to create my own game. My program starts the user off with 500 credits and ...
2
votes
2answers
597 views

Player classes for a playing card game

I have a simple base class and two derived classes. However, when I'm creating new instances of that class, the line where I instantiate the variables is getting way too long. I have it on two lines: ...
8
votes
2answers
1k views

WinForms Poker (complete project)

I have quite huge question/favor to ask but I hope I can get some useful answers. This is my first complete project, I'm still learning C#, my first programming language. I'm afraid that there will ...
1
vote
2answers
136 views

Derived methods with Poker classes

I have an interface with two functions. This interface is being inherited by an abstract class which implements just one of those functions. The other one is left to be implemented by the derived ...
6
votes
1answer
966 views

Defining what combination the user have in Poker

I'm developing a C# Poker app and I currently use the modulus and the divide operator % , / and dividing by 4 because there are 4 cards of the same type but with ...
6
votes
3answers
24k views

My first finished Python program: a deck of cards

I've recently started learning how to code in Python, and have even more recently learned the basics of object-oriented programming. Feeling inspired, I started on a program that would generate random ...
3
votes
2answers
280 views

Chinese Poker using classes

I developed a Chinese Poker game for better understanding classes in Python. It is not finished yet, but the main part is. The game mechanics: There is 1 board for each player. Each board have 3 ...
2
votes
2answers
4k views

Simple Blackjack/21 game in console

I made a simple Blackjack/21 game in C++. It does not use any fancy graphics, just the console output. It is as simple as it can get. ...
3
votes
1answer
323 views

Python Blackjack program

I just finished making a Blackjack program, and I hate my global variables in the program. Is there any way to change the code to not use globals and still work? ...
1
vote
1answer
541 views

Player vs. computer Blackjack game

I would like to improve my code. I am not a Python expert, so I am glad for any help. I would like to remove redundancies, unnecessary code, and change things that might shorten it. ...
5
votes
1answer
411 views

Shuffle a deck of cards, using the overhand shuffle method

I've started learning Clojure, after many years of Java. As one of a series of exercises, I'm writing a simple card game, and the overhand-shuffle function is shown ...
5
votes
1answer
817 views

War Card Game Simulator

This is the second thing I've ever written in Python. I am just looking for what I could improve upon along with things that could be done better. It is as compact as I could make it with my current ...
12
votes
2answers
2k views

“War” card game which includes betting “money” as well

I have created a JavaScript based game, which is based on the card game War. I think I am reusing a lot of my code, but I am not entirely sure what I can really improve. I have a lot of functions, ...
7
votes
3answers
2k views

21 game similar to Blackjack

I just finished coding a game of 21, similar to Blackjack, but with a simplified dealing mechanism. ...
5
votes
2answers
781 views

Multiplayer BlackJack using Vector

This is a small program I wrote for GCSE computing, it operates using Vectors and that's pretty much it, wondering if you could tell me if there is anything I could do better. BlackJackv2.cpp ...
8
votes
5answers
1k views

Beginner- Blackjack game [closed]

I was just wondering what every one thinks about my Blackjack game. If there are some things I could change to simple the code down, or if I put some repetitive things I don't need. This is my first ...
5
votes
1answer
146 views

Project Euler Problem 54 in Haskell

I wrote an implementation in Haskell for Project Euler Problem 54: The file, poker.txt, contains one-thousand random hands dealt to two players. Each line of the file contains ten cards (separated ...
8
votes
2answers
939 views

UNO for ncurses

I've been teaching myself C for the last few months. As a learning exercise, I set out to write an ncurses implementation of the classic card game Uno, mostly because it was was one of the simpler ...
6
votes
1answer
360 views

One-handed Solitaire algorithm

My attempt at a simulation of one-handed Solitaire. Any comments welcome! ...
1
vote
1answer
106 views
2
votes
2answers
14k views

Class to represent playing card

I admit I'm sort of stuck on this. I couldn't think of a better way of representing the card value that will be used in a playing card game. How well thought out is the casting an enum value to an int?...
4
votes
3answers
4k views

Poker game implementation

I have included almost all features that real poker game contains, but even tho I tried to make it as clean as possible, I think it can be done much better. I used inheritance to somewhat distinct ...
12
votes
2answers
11k views

Jacks or Better

This is a start towards implementing a poker-like game called Jacks Or Better. Before proceeding to improve the way cards are shuffled and dealt, I would really appreciate help cleaning up my code. <...
3
votes
1answer
365 views

Poker deck class /w generator function and list comprehensions

There are multiple aspects in the code I do not really like. [card for card in ...] looks really lame, also ...
3
votes
2answers
337 views

War playing cards based game

How can I make this "War" card game code more visibly pleasing? ...
11
votes
1answer
1k views

Poker probabilities finder

This code finds the probabilities of the various scores in Poker. It uses a Monte Carlo approach, in which, two million (\$2 \times 10^{6}\$) hands are simulated and evaluated, not an exhaustive ...
3
votes
4answers
4k views

Simple Blackjack implementation

Continuing my previous post, I have completed my game of Blackjack, the simple version. I am aware it's very long. I haven't included some of the suggested changes suggested in the previously to the <...
5
votes
1answer
2k views

Deck of cards implementation

Update: Simple Blackjack implementation I was playing Blackjack in a phone app and decided to try to do the game in Java, using the console for a start. So far I'd like to review the deck of cards ...
7
votes
2answers
2k views

Project Euler - Problem 54: testing poker hands

This was a very fun and thought provoking problem, and I'm quite proud of the way I was able to pull it off. I broke it down into 2 parts, testing and comparing. Testing each group of cards for ...
2
votes
2answers
4k views

Edited simple Blackjack game in Python 3.4

I'm a beginning Python programmer, and earlier I made a simple Blackjack game in Python. The original version (which can be found here) got a lot of great feedback, so I rewrote the entire program to ...
6
votes
3answers
10k views

Simple Blackjack game in Python 3.4

I made a simple Blackjack game in Python 3.4.3. I'm a beginner, so it would be awesome if you could rip up my code and tell me everything I did wrong. I know there's no insurance for when the dealer ...
6
votes
4answers
14k views

Playing Card & Deck Class in Java

I am currently learning how to write code in Java. To improve my understanding of OOP concepts, I am creating a playing card and deck class. The deck has the functionality of drawing and shuffling. I ...