Skip to main content

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
3 votes
2 answers
282 views

Text-based blackjack in python

This is code for a text-based game of Blackjack. I would also like advice on how can I implement a betting system in this program. For example starting with an amount of chips and choosing how much of ...
vaun's user avatar
  • 31
3 votes
2 answers
117 views

Simple Blackjack game with card art

I have reached a point in my course that I feel I could use some feedback as to how my code looks and hopefully some direction on some best practice methodology going forward. I know I have a long way ...
ChucktheHeathen's user avatar
3 votes
1 answer
144 views

Simple blackjack program in Java

I wrote this blackjack game for my APCSA class (already submitted) and was wondering if anyone had feedback on what parts of it are improperly written. My main concern is the fact that I am printing ...
nohgo's user avatar
  • 31
1 vote
1 answer
97 views

Poker Hand Evaluation evaluation

Several days ago, a question on this topic was posted to SO. The problem turned out to be the OP's test cases did not reveal a deficiency in the code. This challenge caught my attention. Writing the ...
Fe2O3's user avatar
  • 273
3 votes
1 answer
148 views

Combo Matching in a digital implementation of Reiner Knizia's 'Schotten Totten'

I'm implementing Reiner Knizia's card game 'Schotten Totten' in Python. It's a card game for two players, where you compete to claim boundary stones between you and your opponent by forming poker-like ...
Jan van Wijk's user avatar
1 vote
2 answers
103 views

Create a "similar" hand of cards

Is there a meaningful way to simplify and refactor this function? It sorts the flop by rank and assigns a new suit according to the sorted rank order. Higher ranked cards will be assigned spades, ...
Carol Owens's user avatar
3 votes
1 answer
147 views

Terminal Based Blackjack

This is my attempt at a terminal based blackjack game. Currently, the game does not support betting, although I intend to add it in the future. I would very much appreciate general feedback, but I am ...
Katie Grace Porter's user avatar
1 vote
1 answer
196 views

Terminal War Game

First I would like to thank everyone for whatever help you may offer me. In full disclosure this is a project for a bootcamp class I have. My problem is, and I've asked them about this, that they aren'...
Infinite Grasp's user avatar
2 votes
2 answers
1k views

Poker hand valuator in Python

As you will probably notice very quickly from the code below, I'm not very experienced coder. Below is my attempt at valuating poker hands in Python. The code below may not be pretty but it seems to ...
Tom Mart's user avatar
0 votes
1 answer
77 views

typescript poker filter pairs from 7 card deck

I am making a poker game and poker-evaluator that I am using to tell me only the outcome from the cards ...
user266203's user avatar
1 vote
1 answer
148 views

Simple Blackjack game

This is my simple Blackjack game made in Python. I would love some feedback to write better code. ...
Daniel Russ's user avatar
2 votes
1 answer
107 views

Simple BlackJack Card Game - First OOP Code

Blackjack card game with hit and stand. Wasn't allowed to use functions outside of classes in code. Had some difficulty with __str__ dunder method on Dealer and ...
Beginner's user avatar
  • 189
1 vote
2 answers
105 views

Object-Oriented Blackjack V2

[Edited] formatting and Flake8 linter corrections Four days ago I posted my first object oriented programming project. Everything I have learned to date is self-taught and posting project to receive ...
Infinite Grasp's user avatar
6 votes
4 answers
268 views

Object-Oriented Blackjack

[Edited: added V2 link] BlackJack V2 - Github This is my first post, and I was actually going to post this on Stackoverflow when I was rather suggested posting the code here, as it may be better ...
Infinite Grasp's user avatar
2 votes
1 answer
287 views

Pick two random cards from a standard deck

I wrote this code as a refactor of code I saw on Programiz. I thought about this refactor before going to bed and implemented it successfully in code. ...
dylanm's user avatar
  • 23
5 votes
1 answer
330 views

blackjack dealer hand generator

I wrote a piece of blackjack code - for dealer dealing cards to himself (python). My question is how can I make it more efficient, faster and neater. I ran it for 1.000.000 iterations and it took 14.7 ...
Edward Henry Brenner's user avatar
2 votes
1 answer
461 views

Simple Java Solitaire / Patience card game

I made a simple Patience/Solitaire card game. The cards don't use images but JLabels and JPanels. The game is finished when all cards are on their suit piles. Card movement: mousePressed : card -> ...
Si Vafo's user avatar
  • 53
1 vote
2 answers
201 views

A card game deck/hand manager

I started writing a card game in C++ yesterday, just as something to do to familiarize myself with the language. When I showed it to a friend of mine in the compsci field he said I should share it ...
Morgan's user avatar
  • 11
3 votes
2 answers
757 views

Card game using OOP

I already know that I shouldn't really use the global function and that how I judge who wins is also really inefficient so I would appreciate improvements for that. I watched a tutorial about Object ...
Flavour's user avatar
  • 31
5 votes
1 answer
3k views

Python blackjack code

Code below, very new to python, would love some constructive criticism, mainly in relation to what I could have improved on, if my use of aces (where I subtract 10) is smart, and my use of functions? ...
Ali's user avatar
  • 51
3 votes
0 answers
78 views

Blackjack Python Code Feedback

Been working with python for a couple years on the side, looking to get feedback on this Blackjack game I made for some OOP practice. Code executes as expected (and I know the game is incomplete - no ...
Josh Dickman's user avatar
4 votes
1 answer
1k views

Blackjack game in C++

I developed a blackjack game. I am relatively new to c++ and OOP, so I am asking for feedback on what could be improved. This game features betting, taking a card, standing, and splitting a hand. ...
Andrei Rost's user avatar
2 votes
0 answers
79 views

simple OOP Blackjack

It has been a long time since I have gotten into OOP with python. I made this short little program. Are there any ways that I can make it more clear or concise (pythonic if you may)? ...
Thornily's user avatar
  • 121
3 votes
0 answers
99 views

C++ OOP for BlackJack

BasePlayer.h ...
user257428's user avatar
3 votes
2 answers
370 views

Blackjack implementation - Java

I have inspired from the recent blackjack question here and decide to code for simple blackjack console application Please review and let me know What can improve on the code? Rules for the ...
HariHaravelan's user avatar
3 votes
1 answer
466 views

Blackjack game in python w/ bot

I am a beginner programmer and this is my first project, a blackjack game with a functioning dealer in python. Any feedback would be appreciated (especially if its about bot improvement). ...
Sukrit Desai's user avatar
3 votes
1 answer
701 views

Python Poker Hand Comparison Progam

I recently started learning Python and the first program I've made is a program to determine the best 5 card hand from seven total cards and then to be able to compare two different hands to determine ...
Doug160516's user avatar
2 votes
1 answer
356 views

C++ Blackjack game (rough version)

Below is the Blackjack program code. How do I make the code look nicer? I feel like the code is super messy and I was wondering how I could make it look better or if there are better ways to write ...
Terry Brock's user avatar
9 votes
1 answer
2k views

Card Shuffle without using any help C#

I'm new to C# but not 100% new to development. I wanted to try writing a Card Shuffle + Card Dealing algorithm using as least as possible inbuilt functions or any libraries and no internet use to ...
DaLegacy's user avatar
  • 101
2 votes
0 answers
125 views

Can we make a worse automatic card shuffling machine?

So I've been droodling on a blackjack project, and one of the issues we need to solve is how to shuffle the cards. I've implemented a method that simulates hand shuffling (E.g split the shoe (either 2,...
N3buchadnezzar's user avatar
1 vote
1 answer
100 views

Java: Using one class or algebraic data types to model different state?

I'm creating a tool to analyze a card game which is played by three players. A Card is associated with a number of points and looks like this: ...
user253872's user avatar
3 votes
1 answer
390 views

OOP Blackjack in Python 3.9.9

I've noticed I'm not the first to post this topic. As a matter of fact, I have taken some inspiration from Victor Nguyen Bao's post to help structure my code. Here's the link to his code: Structured ...
BitEagle's user avatar
4 votes
2 answers
92 views

Would love some insight on the current state of my Blackjack code

I started coding blackjack from scratch and just finished the basics so I would love some insight. I would really appreciate if any of you could look through it and let me know if there's anything I ...
obliterate's user avatar
3 votes
2 answers
133 views

A very basic Black Jack program, which just lets you play one round without any balance or betting

I just wanted to make a fun project for practise and as far as I know the program runs just fine without any flaws, but I would like to add an option to it, if a round ends to ask the user if he wants ...
Maxell 's user avatar
4 votes
2 answers
2k views

UNO card game with AI players

I had lost a lot of cards of my UNO deck, and was frustrated, and that's when this idea struck my mind. I chose C++, knowing it would be hard, just to improve my understanding of the language. ...
Random_Pythoneer59's user avatar
3 votes
1 answer
1k views

Monte Carlo Simulation of 7 Card Stud Poker

I've completed this as part of an online programming course (in which code review is supposed to be done by fellow learners, but it's been a very long time and none of them have reviewed this), and ...
John's user avatar
  • 33
1 vote
2 answers
261 views

Card deck for Blackjack in an OOP style [closed]

So far I have made a class called Deck, to create and shuffle a deck of cards, and a class called Player, which I want to use to create the gambler and the dealer. My Player class inherits from the ...
Matthew's user avatar
  • 23
6 votes
2 answers
324 views

ASCII-based OOP blackjack game in Python

I'm new to programming and have been teaching myself to code for about 6 months. Since I have no one to ask about any of coding-related questions, I may have developed bad habits in the meantime, but ...
e1630m's user avatar
  • 128
4 votes
2 answers
928 views

War card game with random play

I'm trying to learn C++ with a background in python. This is my first program besides general practice. I wanted to remake the war game. I'm looking to get feedback on the C++ equivalent of its ...
user249135's user avatar
5 votes
3 answers
1k views

Text Based Blackjack

I wanted to make a blackjack game to use while bored, but it turned out to be far more complicated than I thought. ...
user avatar
4 votes
1 answer
181 views

Deal and evaluate a Bridge hand

I am building a little helper for the card game Bridge. The aim is to generate a "hand" of 13 randomly-dealt cards, and then to run various calculations on the hand to help a player with the ...
Lone Wallaby 's user avatar
3 votes
1 answer
2k views

A versatile deck of playing cards. Standard 52-card deck and more

I have seen many posts regarding a standard 52-card deck of playing cards. I recently was composing an answer to one such post when I realized my answer should be its own post since (A) the answer ...
Rick Davin's user avatar
  • 6,317
2 votes
1 answer
128 views

Main loop for a text-based Blackjack game

Is there any way to reduce this code? It repeats itself, but I cannot find any way to reduce it because it is only repeating inside one elif. Sorry I'm a beginner my code is quite bad It repeats here: ...
Tassanix's user avatar
3 votes
1 answer
987 views

Poker Hand Evaluation (speed optimization)

Given a two-card poker hand and a board of 5 cards, I want to evaluate the player's hand strength as listed here. The evaluation of a poker hand was measured to be ~100 microseconds on average. ...
J. Grohmann's user avatar
7 votes
1 answer
2k views

Blackjack game in Java

So this is a blackjack game, any feedback or tips on what I should remove from the code that is not needed is very appreciated. Note: some of the names of classes or variables are in Swedish but it ...
Golden's user avatar
  • 105
10 votes
1 answer
19k views

Deck of Cards written in C++

I created a deck of cards that I used in a BlackJack game. I stripped out my black jack logic and left just the Deck, card and minimum dealer. The deck class is there because I want to create ...
Off_grid_coder's user avatar
2 votes
2 answers
817 views

Blackjack script in Python

Recently I had a python test and, unfortunately, I failed. I'm going to re-do my test and the teacher gave me the tip to work more efficiently and clean. To practice this I made a blackjack game about ...
liteversion's user avatar
8 votes
3 answers
2k views

C# Blackjack prototype

I would like some feedback on my code, I'm new to coding with C# but I do have some knowledge on Lua and Python. Is there anything that I need to change/clean up to make it more simplified? ...
Willn't's user avatar
  • 91
4 votes
2 answers
656 views

Three Card Monte game using Java

I made a Three Monte Card game using Java Problem: This is the original "ball and cups" game where you try to find out which cup has the ball under it. You may play with three cups and a ...
user avatar
3 votes
1 answer
98 views

follow up: Blackjack with card representation visuals

This is a follow-up to my original post of Blackjack with card representation visuals I was given some very helpful advice by @Reinderien and @Linny which I greatly appreciate. I have done my best to ...
Zach Sonnenblick's user avatar

1
2 3 4 5
8