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
7
votes
1answer
700 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
571 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
145 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
353 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
534 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: ...
8
votes
3answers
1k 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
155 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
1k 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
596 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
70 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
1k 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
667 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
1k 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
163 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
1k 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
982 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
2k 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
326 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
432 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
428 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
104 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
645 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
4k 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
1k 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
171 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
273 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. ...
10
votes
3answers
4k 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 ...
3
votes
3answers
1k 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
37 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 ...
2
votes
1answer
1k views

Simple Blackjack game in console (update)

A couple of days ago I posted the code for my Simple Blackjack console game. I have got some good reviews and since then I have been trying to improve the code. That previous question can be seen here:...
3
votes
2answers
471 views

Python 3.6.1 Linux - Blackjack game

Attached below, is the full program for the simple, text-based blackjack game that I have recently finished developing for Python. Upon review, I was wondering if anyone out there would be able to ...
15
votes
4answers
11k views

Simple Blackjack game in console

edit: After receiving the great feedback, I have tried to make my code better. The new version can be seen here: Simple Blackjack game in console (update) This is one of my first finished projects ...
1
vote
1answer
4k views

Simple Deck of Cards Python Program

I have created this program and intend to implement it into basic card games that I create. I would like help cleaning up redundant code and overall, make it more concise. For example: I couldn't come ...
3
votes
6answers
2k views

Blackjack game interview task

As part of a recent interview, I was assigned to write a small BlackJack program. After submitting the solution, I received an answer that "the solution was functionally OK, but was way below their ...
2
votes
0answers
65 views

My Jack slapped back. (tkInter learning project follow up)

This is a follow up to my question here about my slap-jack program. I've tried to implement the suggestions that were given in the accepted answer. (Though I never was able to figure out how to ditch <...
1
vote
3answers
1k views

Simple Blackjack game in Python 2.6.9

Like the title says, I made a very simple game of Blackjack using Python version 2.6.9. I am relatively new to python and programming so I would really appreciate some constructive criticism to help ...
2
votes
2answers
365 views

Console single player blackjack versus a dealer again

This is the second pass on this. pass one A single player versus a dealer. It does not perform bets - it only track wins and losses and has no splitting. Other than that I tried to get it all in. I ...
1
vote
1answer
2k views

Single player console Blackjack game

This is just a single player versus a dealer. I'm not worried about execution time. It does not perform bets - it only track wins and losses- and has no splitting. Other than that I tried to get it ...
8
votes
1answer
821 views

Black Jack Game in Python (Jupyter)

I am working on Jupyter Notebook and I am new to Python. I have created this BlackJack Game (This is my 2nd Project as I am Learning Python. See my 1st - Tic Tac Toe ...
2
votes
2answers
235 views

Generic OOP Implementation of a Deck-package in Java

I have posted some versions of this question (or at least similar ones) before. But I once again tried to improve it. The goal is to be able to use this package whether it's for a traditional card-...
5
votes
1answer
48 views

Pontone styled card game

below is a code to play a game of a popular card game, Pontone. you play your game against the dealer. your hand is randomly made and so is the dealers from the set of cards. you play through the ...
1
vote
1answer
327 views

OOP Generic Deck/Card implementation in Java

I decided to give this another go. Last attempt can be found here This time around I tried my best to make this as generic as possible. The goal is to make this usable for any types of cards, not ...
0
votes
2answers
82 views

Acey Ducey game - followup

I'm a beginner in Java and want to improve and learn. This is a followup of my previous post. This is a game called "Acey Ducey": The dealer shows you two cards. You decide whether you want the ...
3
votes
0answers
455 views

Hint generation code for freecell game

I am writing a text-based freecell game in python 3. I am looking for a way to generate hints. A hint should simply be all the possible moves that you can make, excluding moving a card to a free cell (...
3
votes
2answers
979 views

OOP implementation of Blackjack in Java - part 2

Part 1 Last time I got a lot of great advice, so this is take two with all that in mind: My main concern with this implementation is the use of Inheritance (A base Player) vs having that as a ...
3
votes
4answers
929 views

OOP implementation of BlackJack in Java

This code is not done, but still fully functional. But, before I continue I'd really appreciate some input on the code-structure as is. AbstractHand.java ...
4
votes
3answers
336 views

Acey Ducey game

I'm a beginner in Java and want to improve and learn. This is a game called "Acey Ducey": The dealer shows you two cards. You decide whether you want the dealer to pick a third card or not. If the ...