Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

3
votes
2answers
58 views

Creating a Swift game of Uno

I've starting writing the card game Uno the past couple of days and was wondering if you can review my code please. The initialization is done I think, a couple of game functions already exist, please ...
-2
votes
0answers
14 views

Getting a Segmentation Fault after one iteration of the loop for text-based bluff(cheat) card game [on hold]

Please look into the following code for a text-based bluff(cheat)game. it should display the cards in hand for each user before their turn. ask for the cards they want to call, and then for the actual ...
3
votes
1answer
53 views

Card based game in Android

I am developing a card game in Android. This is my first time I am working in Android,. The game contains following features: It will be a 6 player game. There are two decks on the table, one with ...
1
vote
0answers
35 views

Sorting cards by suit and value using Shell Sort

The question description: put a deck of cards in order by suit (in the order spades, heart, clubs, diamonds) and by rank within each suit, with the restriction that the card must be laid out face down ...
4
votes
4answers
119 views

Cards shuffling and dealing program

The program interacts between cards and four players among whom cards are to be distributed. The Program do the following function Creates a deck of cards. Shuffle the deck. Shows the deck. Deal ...
5
votes
3answers
82 views

Duel-type card game in C

This is similar to the game War, but with notable differences. For this program, it is the player versus the computer (so each with half of the deck). They draw the top card of their deck and compare....
5
votes
2answers
351 views

Python Blackjack game

This is one of my first programmes in python and I really could use some feedback on how to improve. It's meant to be a multiplayer game by handing the computer to the next player at the end of each ...
3
votes
1answer
38 views

Bist-o-yek: a card game similar to Blackjack

Bist-o-yek (21) is a Persian card game very similar to blackjack, except it doesn't have things like double down and split. I did, though, change it a little. For example, added dealer dealing to 17. ...
1
vote
1answer
38 views

React component for Pai Gow game

TL;DR what should I do if I have too many methods in my parent component?? I'm making a card game (Pai Gow Tiles) using react and I am having trouble finding a way to format my parent component. I've ...
2
votes
1answer
66 views

Self playing console Blackjack game with four players

I want to clean this code to be more production ready. What can be improved, added or removed? ...
1
vote
1answer
75 views

Python Text-based Card Game

I have programmed a card game in Python. How can I improve the code? There is a deck of cards. Each cards has a colour (red, black or yellow) and a number from 1-10. There are two players. Every ...
5
votes
1answer
152 views

Deal three Poker hands of five cards each in Python

I'm a beginner at coding who recently started learning Python, and I think I have grasped the basics. Now I'm working on my first "proper" project in Python. The problem is to have the program: ...
2
votes
2answers
50 views

Continuous Shuffler with “linked loop”

As an academic exercise, I decided to implement a continuous shuffler, as seen on casino blackjack tables. It operates by storing a "linked loop" (a linked list with the last element linked to the ...
5
votes
1answer
107 views

Python card game [closed]

I have programmed a card game in Python. It is over 700 lines long. How can I improve the code? There are two players. Every round, each player takes one card from the top of the deck. Those cards ...
0
votes
4answers
233 views

Simple OOP Blackjack game in Java

I've created a relatively simple Blackjack game in java. The reason why I decided to do this specific project was to improve my object orientated programming in java. I will post my code so feel ...
6
votes
4answers
348 views

The card game war

I'm a beginner programmer looking for a review of my simple war card game program I made. Each player gets a deck and you pull 1 card at a time and compare the 2. Highest value wins. Do that until the ...
2
votes
0answers
63 views

One-handed Solitaire Game Choice Generator

I want to test some different endgame scenarios for one-handed Solitaire where the removal of the cards if the suit or value match is optional. I've written a simple generator which yields at the ...
1
vote
1answer
57 views

JavaFX controller for a poker game

I am making a poker application in JavaFX. When I try to display the cards on the screen it is working perfectly fine. Yet I have a method with a lot of duplicated code in it. I have tried to ...
7
votes
1answer
114 views

C# Singleplayer Blackjack Game

I recently finished a simple Blackjack game that I made to get better at C#. I am wondering how I can better organize or simplify my code. There are 4 files: Program.cs ...
0
votes
2answers
198 views

Blackjack strategy simulation

I'm very new to python (been coding for about two days) and have created a programme that simulates blackjack games so that I can work out optimal strategy over many iterations. The problem is that ...
5
votes
3answers
121 views

Java version of card game “higher or lower”

First of all, I have my basic main method which does pretty much nothing: ...
4
votes
1answer
291 views

Macau Card Game (with graphics)

I've already made a version of this game which was supposed to be played on the console. I got it reviewed and applied almost all of the recommendations I received in that topic. Thus you can consider ...
0
votes
1answer
185 views

Playing cards with ReactJS

I came across problem 54 on projecteuler.net and decided to give it a go using ReactJS. I have had Angular experience prior to this. I wrote a couple of fully tested components. I think that they only ...
1
vote
1answer
472 views

Choose random card from a deck

still new to java and i am trying to improve my understanding and use of OOP concepts.here i am supposed to print the name of a randomly selected card from a deck of 52 cards. Program: ...
8
votes
3answers
840 views

Macau Card Game

I've implemented a card game called Macau. This is a follow-up from this topic, where I tried to get the game's design right before actually implementing it. Even if the game is presented on that ...
7
votes
3answers
125 views

Simulate a simplified version of Exploding Kittens in Python

PURPOSE: In order to get comfortable with Python classes and object-oriented programming, I've decided to simulate the Exploding Kittens card game. To make it easier to program, I've greatly ...
6
votes
3answers
1k views

Comparable playing cards

I have written a working implementation of a Poker card that I want to be comparable. I feel that my solution is somewhat bloated in C++, and want to ask if I should have done something different to ...
5
votes
2answers
290 views

Simulations of the card game Crazy Eights

The following code simulates the card game Crazy Eights. Some of the methods seem a little clunky or superfluous (although I've yet to come up with a better solution). I'm specifically referring to ...
2
votes
1answer
214 views

A simple Blackjack game implementation in Python

This program is an implementation of the Blackjack which is similar to what is played in the casinos. Here were the requirements: I needed to create a simple text-based BlackJack game The game needs ...
2
votes
1answer
66 views

Cards for Monster, Spell and Trap interfaces [closed]

So I wrote a card game in Java/JavaFX but I don't particularly like this solution and I was wondering if you guys have any better solutions: ...
6
votes
3answers
314 views

My First Deck of Cards

I'm looking for an honest review of what I've got thus far. I'm still trying to get my head wrapped around software development and have picked Java as my starting language. That said, I figured that ...
10
votes
4answers
442 views

Another attempt at a Blackjack game

This is a follow up question to this one. I have been working on this game for some time, and now I would like it to be reviewed. Most importantly, I want to know about my code readability, ...
5
votes
2answers
426 views

My attempt at a Blackjack game

Please also see the new version here So I've been trying to make a blackjack game as my first attempt at an OOP project. The program is working, but not yet finished as it is lacking three major ...
5
votes
1answer
98 views

Card game ranking

Badugi is a 4 card low hand poker game. i / 13 is suit and i % 13 is rank. Cards from 0 to 51 inclusive. Straights and flushes do not count. The best hand is A234. The worst hand is KKKK. If you ...
3
votes
1answer
480 views

JavaScript Blackjack game

I am learning javascript with the course Javascript Getting started by Mark Zaymota. Currently the code is in a script.js file, and I was wondering how could we refactor it to extract classes from it....
10
votes
1answer
330 views

Blackjack in Python (using Turtle)

I've been programming for 2ish months and I was programming Blackjack on a school computer because I was bored. If you guys could check to see if there are any problems with it that would be great! <...
10
votes
6answers
2k views

Poker dealer Hold'em

This represents a table (server) for Texas Hold'em. This is not a full Hold'em game but it is working code for what it does. It shuffles, deals the hole cards, deals the board, moves the blinds, and ...
6
votes
2answers
635 views

Structured blackjack game in Python 3

I am new to programming, and I am doing some homework to get more hands on coding experience. I have written a blackjack game in Python 3 and would like a code review of any and all of my code. ...
8
votes
1answer
177 views

Simple Python 3 Blackjack

I've been screwing around and adding in new features for a few days(aces high/low, sayings for the dealer, etc.). However I'm fairly inexperienced and I'm wondering if any of my code can be replaced ...
7
votes
1answer
306 views

Blackjack OOP logic in Python

I am attempting to write a game of blackjack using classes in Python. Any advice on keeping it DRY? I seem to be creating too many lists in lists. Should I name the keys in the dictionary or just ...
5
votes
2answers
239 views

Poker equity calculation algorithm

I writing some specific poker equity calculator. Basically, equity calculator tells how much one hand is more profitable than other. I have written such calculator and it works, works fast, but there ...
2
votes
1answer
90 views

1/2 finished poker game

I'm trying to make a poker game, but right now my code - to me - looks way too crowded, and I can't seem to find anything to shorten it and make it look cleaner. Because of that, I came here to see if ...
5
votes
3answers
274 views

Poker Holdem Hand Evaluation 7 cards to 5

I'm building a poker Hold'em hand evaluator. Ultimately my goal after building the evaluator is to build a client on the browser but that's far from now. What I've done so far is a hand analyzer that ...
4
votes
2answers
2k views

Poker game in JavaScript

I am creating a Poker game using the follow hand precedence (winning hands in descending order): So if the player enters 5 cards: TH JH QH KH AH (i.e. 10Heart JackHeart QueenHeart KingHeart ...
4
votes
3answers
713 views

Simulated card trick with splitting and reordering

I need a bit of help with a practice Computer Science coursework. I have written a code for a magic trick (more information below) using Python 3.x, and for one particular section, I need to suggest ...
8
votes
1answer
149 views

Scoring poker hands

Just for fun I solved another Project Euler problem dealing with poker cards. I think it is also part of other programming puzzles which can be found in the web. While there is not much mathematics in ...
1
vote
3answers
186 views

Deck Shuffling Method

Just wondering if you guys think this is a good way to shuffle a deck or a bad way. Updated to show the GetRandom function as requested. ...
11
votes
3answers
3k views

Simple OOP Blackjack game in Python

I made a simple text based Blackjack game in Python 3 to help me implement OOP concepts. I only made one function outside of my classes which takes the user's name at the beginning and then ...
4
votes
3answers
750 views

Blackjack Game in Ruby

I built a simple Blackjack game in Ruby on Rails, and am looking for feedback, because I believe I may have overcomplicated things. This was a homework assignment, where I was told to make 1 be an Ace ...
1
vote
0answers
29 views

Blackjack Insurance Object that implements Null Object Pattern via __new__

This example of a blackjack insurance object is typical of how I find myself writing classes in Python. I particularly wanted some feedback on my use __new__ to ...