I am trying to do a deck of cards in linear form so that I would be able to tell if I am guessing the right card. The program should be able to tell if the guess is getting closer or not. I made a random number generator (randomNum = rand() % 52) and the user inputs the rank and suit. What I did with this is 2 of clubs would be the first card in the deck, Jack of Clubs would be no. 10, followed by the queen, king, and ace. The "lowest card" would be 2C and the …

Member Avatar
Member Avatar
+0 forum 5

Although I've been programming as a hobby for a while, most of it has been procedural and I've done very little OOP, and not very competent with the inheritance hierarchy of classes, which is the reason for my post here, to get a bit of advice as to whether im thinking correctly. As a long term project I've decided to make a game of texas holdem poker and get more familiar with OOP as I go along. First port of call is to create a class for a deck of cards, and my first question is whether a deck of …

Member Avatar
Member Avatar
+0 forum 8

Hello guys, so I am facing a problem to understand the following.. Creating a GUI based program that has a user control box that contains a list of images of a 52 cards deck, the cards are based on an enum actually 2 enums one for the rank and one for the suit but i can choose the rank and the suit then hit flip and it should show the image of the card.. Now I have the list of images imported as a recourse, but i dont know how to set the images to the enums and how to …

Member Avatar
Member Avatar
+0 forum 1

This program is supposed to shuffle a Deck of cards and display them so I know it is working correctly. But one of the values displayed is -858993460 which is not possible when it should only be between 1 and 52. Obviously there is some sort of data loss going on but I cannot figure out what exactly it is. Please help me solve this, thank you. #include "stdafx.h" #include <algorithm>//swap #include <iostream> #include <ctime> //system clock #include <cstdlib> //random using namespace std;//Swap lives in std namespace const int nLow=0; //lists of constants const int nHigh=52; const int nSize=52; int …

Member Avatar
Member Avatar
+0 forum 2

Hi. Im trying to write a simple deck of cards program. I am having difficulty in expressing my integer deck into a printable form. The deck is generated as this: 00102030405060708090100110120011121314151617181911011111210212223242526272829210211212203132333435363738393103113123 The leading numbers assign to suits and the following number assign to card rank. Basically how can I convert this to print in the form: Card 1: Ace of spades Card 2: 2 of spades Card 3: 3 of spades etc; Could I use if statements and BREAKS to change the ints into strings? Perhaps a char value for suit would be better.. Any suggestions? Any help would be …

Member Avatar
Member Avatar
+0 forum 7

Having built many web applications with ajax / php / mySql I was presented with a "simple" task form a friend of mine. We built a database of every MTG card for a website, then figuerd we have all this data lets build a simplr "tabletop" emulator to play between us, nothing that would be public or against the terms of MTG / WOC. So knowing Ajax I figured on the following - Ill create a mySql db to store the gamestate, send new positions to the server and query for changes made by player 2, then relocate the objects …

Member Avatar
Member Avatar
+1 forum 3

Hello, I am currently writing a card game in Java. My question is when I write the follwoing code below: `Inline Code Example Here` 38 // select a random number between 0 and 51 39 int second = randomNumbers.nextInt( NUMBER_OF_CARDS ); Will the program properly generate 52 cards? Should I be using ( NUMBER_OF_CARDS - 1) equals 52 real cards or would it properly generate the 52 cards the way I have it programmed? Thanks for all the assistance! Regards, J-Man

Member Avatar
Member Avatar
+0 forum 2

I want to make a simple online multiple player cards game using PHP/Ajax. I guess I need socket programming (I want it to be real time). I've worked with sockets before in Java, but not for an online program, just a network game. I searched but I didn't really find a comprehensive code.Also another issue is that several games might be played simultaneously and I don't want them to interrupt each other. How to manage them all? Could you guys give me a simple understanding of how to do it? Do I need to write two codes, one for the …

Member Avatar
Member Avatar
+0 forum 1

Hey everyone, I wrote some code to create a deck of cards, described the deck and randomly deals 5 cards. First, I want to let everyone know that this is homework for my C-II college class, so I am not looking for any answers, but solutions or guidance in figuring out what I am trying to do. What I want to do with this deck of cards is to shuffle the deck and then deal 5 cards, while not dealing the same cards in that hand. IE: Program deals 5 cards. The 5 cards are as follow (I actually ran …

Member Avatar
Member Avatar
+0 forum 6

Hello everyone, I did have a look around with search option to see if I could get an answer their, but I couldn't quite find my issue(at least I don't think I did). This is for a final project for school where I have to create a class for a deck of cards and let the user do several things with it. One of these things is cutting the deck so that the top 26 cards(assuming this is a standard 52 card dec)are now on the bottom. This is where the problem comes up. [CODE]def cut_deck(self): cut_deck = [] index …

Member Avatar
Member Avatar
+0 forum 2

lets say i have 8 deck of cards how to put all of that inside a array do i have to make a multidimensional array for each deck???

Member Avatar
Member Avatar
+0 forum 3

Hello all, I have been working on a card game for the last month or so and sofar have created the basics ie. cards, deck... The language is ANSI-C and is created in programmers notepad with devkitpro and MLlib. Everything is working greate so far as in I can shuffle the deck deal cards from the deck ect, ect... But the problem im now facing is that I need to search through the AI's hand and see if it can place the correct set of cards on the table which is where im stuck and not sure how to go …

Member Avatar
Member Avatar
+0 forum 3

Hi. Im making a flash cards program and need help with making graphics, making a menu, making it so that they can go back in and access the decks, and making it so i can give it o other people, and a few other things. Here's my code: [CODE] import java.util.Scanner; public class Main { public static void main(String args[]){ // Title Display System.out.println("FLC v0.5"); System.out.println(); // Deck Enter Area System.out.println("Enter Deck Name"); Scanner deckscanner = new Scanner(System.in); String deckname = deckscanner.nextLine(); System.out.println(); // Card Number Entry System.out.println("Enter How Many Cards You Would Like"); Scanner cardnumscanner = new Scanner(System.in); String …

Member Avatar
Member Avatar
+0 forum 6

Ok, so im trying to make my sister a flashcards program with dev c++. What you do is put in the deck name and how many cards you want. Then you go through for each card and put in what's on the front and back. I also want it so you can go back in later and access that deck again. I also want it to have graphics and text input boxes, not the boring black box. It would be grand if you could give me a very rough block of code for it. Thanks!

Member Avatar
Member Avatar
+0 forum 20

I'm reading about two-dimensional and multi-dimensional arrays at the moment in order to better organize user input. I'm trying to create a function that can store a card player's hand. At the moment I'm just brainstorming how it would look and writing out some notes to myself to organize it in plain english before I break it down into C++. So far I've figured this: I'm going to use a two-dimensional array to store cards in a dealt hand. I figured it would have two columns, one to store the card's value and one for its suit. So something like …

Member Avatar
Member Avatar
+0 forum 3

I am trying to make a card class that has a bunch of functions to make it possible for the AI to judge what cards can be played. The card game I am working on at the moment is Rummy by order of my brother. I made a 3 pointer instances of my card class. I think that I will use these to point at other instances and judge whether a card can be played or not. The problem is is that I am a fail at pointers so this whole section is completely useless unless I can figure out …

Member Avatar
Member Avatar
+0 forum 1

My project is to create a solitaire game with a different card deck. I have created four lists with three objecs in each off them and I would like to create 81 unique cards out off these objecs. colors = [blue, yellow, red] shapes = [triangel, circle, square] numbers = [1, 2, 3] grades = [1, 2, 3] cards = [] for color in colors: for form in forms: for number in numbers: for grade in grades: cards.push((color, form, number, grade)) If I want to randomly select three out off these 81 cards. What's the best way to do that? …

Member Avatar
Member Avatar
+0 forum 3

Hi I'm beginning a new game project involving Event data cards. Most have common types of data. They fall broadly into three types: terrain, movement or fire. Although there are some special event cards or modifier cards but on the whole, similar data on the most part. Except the fire opportuninty cards, where only 1 data type is in common. They will be all part of same deck. However, I not sure how best to manage & store the data for gameplay purposes. Are arrays the answer, structs, enums ... something else. Thanks.

Member Avatar
Member Avatar
+0 forum 4

I have a computer that unfortunately does not have a PCI-Express slot, but it does have a AGP slot. I'm looking for a good (not great, because I can't afford it) video card. I feel the motherboard video is causing display errors and delays in loading. I have Comcast internet, and it still seems slow. Is this the reason? Only 64Mb of memory in my video? I'm thinking about buying this card: EVGA e-GeForce FX5200 AGP Video Card - 128MB Light Version 128-A8-N303-L2 I don't do a lot of gaming, only Ricochet (which is a breakout game), but I would …

Member Avatar
+0 forum 0

Here is code which I wrote to experiment how hard it is to get Royal Flush in Poker.

Member Avatar
Member Avatar
+0 forum 3

how many people here are using a credit card for online shopping? do you experience double charges? how do you deal with it?

Member Avatar
Member Avatar
+0 forum 3

Hello! I am new user of this forum, and I want to ask you for ideas for finding the probability of winning in pre-flop, post-flop etc... For example, there are 3 players on the table (2 opponents). A (spade) A(heart) (1st opponent's cards) A (club) 8 (club) (your cards) 7 (club) 8 (heart) (2nd opponent's cards) Your percent of winning is: 9.89 4.97 chance of equal splitting the pot I know how to solve the problem with brute-forcing method and Random function but I want to work smart and not hard. I want to program this in Java or C++. …

Member Avatar
Member Avatar
+0 forum 9

In this program we are going to simulate a simple card game. The rules are that the player selects a card out of a deck of 52 cards. The computer picks a random card out of the deck. The person with the highest card face number wins. In this program it would be very helpful to use the examples of card games in the book. This will give you a majority of the code to setup this program. Then you need to add your own classes and code. You must have 2 classes in your program. One class will be …

Member Avatar
Member Avatar
+0 forum 36

I have been working on a number of card games. Important, of course, is shuffling the deck. I have come up with a few different ways to do this. Currently I do not shuffle, but to deal a card, I lay out the deck in order, selecting a random number between 1 and the number of cards remaining and selecting that card. I then remove that card from the deck so that another card can be picked. There are two main ways to do this, and I am trying to figure out which one is optimal. The first is to …

Member Avatar
Member Avatar
+0 forum 1

I'm creating a program to Deal, Sort, Display and determine cards for a poker game. A word for word of my program is here... [QUOTE]Write a program that will operate on a deck of 52 cards. Your program will: 1. Deal them into four random hands of 5 cards each a. The four hands need to be kept in an array for later use. 2. Sort each hand so that it shows the cards in sequence from two as the lowest to ace as the highest. 3. Display the cards in each hand using the card face (2, 10, King, …

Member Avatar
Member Avatar
+0 forum 12

Hey, how's it going? I decided to pick up Python for the heck of it and have been having some trouble creating this Card Deck class. All this class is supposed to do is initialize a deck, and then draw a card at total random: [code] import random class CardDeck(): suit = ["Spades","Clubs","Hearts","Diamonds"] number = ["Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King", "Ace"] def DrawCard(): randomsuit = random.randrange(0,3) randomnumber = random.randrange(0,12) print ("You drew the " + number(randomnumber)+ " of " + suit(randomsuit) +"!") CardDeck.DrawCard() [/CODE] Each time I try this, the IDLE returns: "NameError: …

Member Avatar
Member Avatar
+0 forum 7

Are there any issues in e-commerce applications if someone wants to use their debit card as a credit card for a purchase?

Member Avatar
Member Avatar
+0 forum 4

Can anyone tell me the best free sites with Christmas cards, templates and games? It is urgent! Please HELP!!! Please HELP!!!

Member Avatar
Member Avatar
+0 forum 3

I remember the day when business cards were small and contained the basic information. It seems though that many internet marketers have a very social media friendly business card, with logos, profile picture, and all their social media contact information. So would you create such a card? If you have such a card, do you think it has helped you become more connected?

Member Avatar
Member Avatar
+0 forum 9

The End.