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.

5
votes
1answer
83 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
83 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
143 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 ...
0
votes
2answers
76 views

Poker Hand evaluation

I want to evaluate Poker Hands an wrote the following Code: https://dotnetfiddle.net/mxMvq9 Anything wrong / to imporve? ...
4
votes
0answers
35 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 ...
4
votes
1answer
172 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
74 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 ...
2
votes
0answers
47 views

Blackjack game: Count Hand Value method

I am almost completing my BlackJack in Javascript. But, I realize that there must be better way to improve the performance for these two methods. Any pointers? ...
0
votes
1answer
68 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 ...
2
votes
1answer
62 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 ...
3
votes
1answer
78 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
98 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 ...
1
vote
0answers
31 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 ...
4
votes
1answer
101 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. ...
6
votes
1answer
176 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. ...
4
votes
1answer
79 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 ...
1
vote
1answer
39 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 ...
7
votes
2answers
664 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 ...
1
vote
0answers
49 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. ...
1
vote
1answer
73 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 ...
4
votes
1answer
60 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 ...
2
votes
1answer
181 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,...
3
votes
0answers
77 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 ...
3
votes
0answers
73 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 relation between methods and attributes different objects. I ...
1
vote
2answers
184 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
1answer
76 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
113 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 ...
3
votes
1answer
80 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
255 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
692 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
130 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
520 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
53 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
53 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
83 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
195 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
759 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
52 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 ...
6
votes
1answer
1k 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
1k 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
1k 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
116 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
124 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
549 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
477 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
143 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
343 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
440 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
2k 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: ...