Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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
5
votes
1answer
38 views

Simplified Blackjack in Python

I just started learning python a couple of weeks back from and like many others here, I too seek feedback on my simplified Blackjack game. I would like to know if the code could have been more elegant/...
6
votes
1answer
100 views

Multi-lang support for names of playing cards

Context: Coming from C# I am building a python 3.6 texas hold'em to get acquainted with different python features. I am currently buidling enums for card-colors ...
8
votes
2answers
125 views

My third game - Poker hand strength analyzer

I'm writting this poker hand evaluator and it's really coming along. But, as you can see I repeat myself many times and I would love to know what's your thought process when you're repeating yourself? ...
10
votes
3answers
137 views

Simpler version of BlackJack game - first OOP

I am learning Python for a few weeks. Last time I started object-oriented programming and I feel like it is really hard for me to write the relation between methods and attributes for different ...
9
votes
2answers
420 views

My second game: War Card game V.1

I'm a beginner programmer that's really motivated at the moment. I made this in two days and I'm really proud of it because I never used any tutorials or any online help. Just good ol' grey matter and ...
11
votes
2answers
11k views

ASCII-fication of playing cards

I am making a small Blackjack game in Python 3. The part of the code I am unsure about is that which allows me to print nice ASCII versions of the card. ...
5
votes
2answers
122 views

Blackjack game: Count Hand Value method

I am almost completing my BlackJack game in Javascript. But I realize that there must be a way to improve the performance for these two methods. Any pointers? ...
5
votes
0answers
71 views

Mahjong hand completeness checking algorithm

As a summer project, I have been working on a small-scale, console-based version of Mahjong (the Rummy-like hand completion game, and not the solitaire version). While having prior knowledge of the ...
4
votes
1answer
77 views

Most idiomatic way of declaring a deck in Rust

I'm new at Rust and I'm trying to implement a cards' deck on Rust, I'm trying to use most idiomatic code I can, but since I'm new at this language, I'd like to hear advice from more experienced ...
5
votes
1answer
62 views

Blackjack CLI in Python 3

This is a simple CLI Blackjack game in python3. I saw that there were others already posted here and tried to implement some of their solutions and logic where I understood it. My game is a little ...
6
votes
2answers
103 views

JavaScript BlackJack Prototype

What would be the best way to organize BlackJack in JavaScript and maybe start with blank slate? Specific areas: Updating UI Incorporating the dealer hand into the ...
6
votes
1answer
176 views

OOP Python Blackjack game with player accounts in PostgreSQL

This is an OOP version of Lastest version of my Blackjack game. Also, it now uses PostgreSQL as database. ...
1
vote
0answers
57 views

Making text based Blackjack game in Java. Can't figure out how to deal with Ace(1/11) and Splitting [closed]

I've been learning java for about a year in University and decided to start this Blackjack game which I can hopefully animate into a full app in the future, although I'm still working on the ...
9
votes
5answers
987 views

Deck of cards with shuffle and sort functionality

Going through Head First C#'s Chapter 8: Enums and Collections, I learned about List<T>, as well as IComparable<T> ...
3
votes
0answers
148 views

Java implementation of Spider Solitaire

I recently cloned a classical Spider Solitaire game from Microsoft Windows XP. I implemented almost all features of the game. Please tell me anything I can do in order to improve my coding style. ...
5
votes
2answers
235 views

BlackJack in Javascript

I have completed my initial version of BlackJack with Javascript and some JQuery. Any thoughts of this version? I can't seem still to implement timer successfully as I have commented out. After ...
5
votes
1answer
116 views

C++ practice project: Blackjack

For the longest time I always felt lost designing a robust OOP program, especially in C++. I felt like I didn't know enough theory or algorithms so I would study and never write code, not to mention I ...
9
votes
3answers
100 views

Console Blackjack game, without split or betting system for now

I never programmed in my life, and I am currently self teaching myself some C++ by reading books, online free classes and googling. After beginning to read about OOP and classes, and after seeing that ...
8
votes
1answer
171 views

A Python Blackjack terminal based game

I am looking for some feedback on my blackjack Python code. Any feedback is much appreciated. Docstring, code etc. Other than that, I need to test it, and I am not sure how to make this code more ...
7
votes
3answers
8k views

Texas Hold em Poker Hand recognition algorithm and implementation

I am designing an in-depth poker game. I am first focusing on recognizing the strength of a hand given the set of cards. Is the following algorithm suitable for the stated purpose? Am I using correct ...
9
votes
3answers
37k views

First attempt at a Java Blackjack game

I just completed my first multi class program, Blackjack, and it works! It allows the user to play Blackjack against a single dealer, with no other players at the table. I was wondering, seeing as it ...
0
votes
2answers
119 views

Poker Hand evaluation

I want to evaluate Poker Hands an wrote the following Code: https://dotnetfiddle.net/mxMvq9 Anything wrong / to imporve? ...
14
votes
2answers
4k views

Let's play some Swift Poker

Before you can do any sort of card game, you must first write some code to define your deck of cards. One thing I've noticed in looking at some of Apple's Swift interfaces is that they very much so ...
5
votes
1answer
89 views

Lastest version of my Blackjack game

This is the latest version of my Blackjack game that uses a MySQL database to store user info. I did everything I was recommended in my previous post, added a ranking system and also fixed a bug where ...
0
votes
1answer
76 views

Forming the best possible poker hand [closed]

This is what the function is doing: it gets two arrays of tuples with 5 items each - hand = [H1,H2,H3,H4,H5] and board = [B1,B2,B3,B4,B5] What I need to do is check all arrays formed by 2 items from ...
13
votes
5answers
6k views

Yu-Gi-Oh cards in Python 3

I made a project in Python 3.7.1 that includes classes to create Yu-Gi-Oh cards. This isn't the entire game; it is just the cards itself. I will create the entire game later. I want feedback on how to ...
4
votes
3answers
5k views

Generating playing cards

This code has several functions and procedures for the program to generate cards like '5 of diamond'. I would like to shorten the code. ...
19
votes
1answer
2k views

Blackjack Strategy

I am creating a Blackjack simulator in Java in order to better understand the language. I have written the basic strategy section for a player and it is terribly long. Is there a better way to do ...
3
votes
1answer
74 views

Blackjack game with database - follow-up

This is a follow-up to my ex-posted Blackjack game that uses a MySQL database to store the accounts and user's money. I tried splitting display_info() a bit, I also ...
4
votes
1answer
108 views

Blackjack game with database

This is the latest version of my Blackjack game and I did a quite big update to it. Now you can make an account that is saved in the MySQL database and you can bet money that are also saved in the ...
4
votes
2answers
114 views

Command-Line Poker Showdown

Further-developed followup to this question Python beginner here. I created a command-line program that generates poker hands (5-52 cards) and compares their strength. On my Macbook Pro, it ...
7
votes
2answers
710 views

Allow console draw poker game to output more hands

I'm an absolute python beginner. I created a draw poker game that works fine up to about ten thousand hands, at which point it starts to freeze and not generate the hands. Given that straight flushes ...
5
votes
1answer
114 views

Blackjack game - follow-up

This is an updated version of my previously posted "Blackjack game made in Python 3". I think I did almost everything @Austin Hastings recommend me to do and I hope you like it. ...
7
votes
1answer
228 views

Blackjack game made in Python 3

This is a simple blackjack game I finished making using Python. I hope you like it and I'm open to any suggestions or critiques you would give me. ...
1
vote
0answers
37 views

Rust trait implementations for a Blackjack game

I am learning Rust. I have build a simple game (Blackjack) to get acquainted. The following code is the code which runs the game logic. The code is part of the larger codebase and works. In the rest ...
1
vote
1answer
49 views

Playing card class, written using enums

I wrote a card class a while back in this post here: Previous Question I know it has been a long time but I recently came back to the project and wrote it using an enum as suggested in the answer to ...
9
votes
2answers
1k views

Blackjack game in Python 2.7

Please review my game. I am learning Python now, so any suggestions are welcome. I am running this on a Linux machine, in Komodo and terminal. ...
1
vote
0answers
73 views

Blackjack simulator for Probability of a dealer bust for each starting card

I came up with this solution to another exercise out of John Zelle's Programming book. ...
2
votes
1answer
428 views

Shuffle deck of cards in JavaScript

I know randomness in programming can be a deep topic, and searching the topic seems to result in Fisher-Yates being the best method, but I'm curious what people would say about this method. Basically,...
1
vote
2answers
6k views

Texas Holdem Poker Game

I'm making a Texas Hold'em game for multiple players. So far, I have finished the flow control for betting / calling sequences, player stack / pot updating, and just now - the part responsible for ...
1
vote
1answer
76 views

Basic playing card objects for games

I wrote classes to model a playing card, a deck, and a player to be used in multiple playing card games. I originally posted a Card class here, and now extended the ...
3
votes
0answers
125 views

Playing card object

I am writing this class to eventually create a playing card game (Spades) and also to utilize the object oriented paradigm. This was my attempt to model a card as an object. Each card has a suit and a ...
4
votes
1answer
85 views

Blackjack Game in Python 3/curses

You were all so helpful with my Tc Tac Toe games in C. I was encouraged to put it up on GitHub and two very helpful users refactored it in ways that really taught me a thing or two. While I have ...
1
vote
2answers
310 views

Playing Card in Swift

I'm trying to properly write a card class in swift. I've been taking classes in software engineering and I need help in understanding how to take a more object-oriented approach to my class. I have ...
6
votes
2answers
19k views

Simple Blackjack game in Python

I am trying to create a simple Blackjack game. I am using GIST because the code sample takes forever to use. Current code: ...
1
vote
1answer
59 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 ...
6
votes
1answer
77 views

Verifying that three cards make a “Set”

The game of Set involves cards with four properties: number, symbol, shading, and colour. Three cards make a "Set" if the property is either all the same or all different across the three cards, for ...
3
votes
2answers
143 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
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
94 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 ...