Can someone please take a look at this for me. I have to create a program that models a simple card game. I have to shuffle the card and deal 1 card at a time and display the card that I have dealt. Not sure how to do this. The code I have is returning 00. I also have to declair a winner. I guess I need to do a nested for loop to check against suit and face of card right.(havent tried it yet). Looking for suggestions or directions in the correct place.
Thanks.
cassyjack 0
Light Poster
Recommended Answers
Jump to PostI did few small changes to your files
CARDS change in card constructor
public Card(int f, int s) { // initialise instance variables face = f; suit = s; //you had suit = SPADE }
DECK change your constructor public Deck() (with 2 for loops) to …
Jump to PostDid you tried a random function as I sugested???
All 5 Replies
peter_budo 2,532
Code tags enforcer Team Colleague Featured Poster
cassyjack 0
Light Poster
peter_budo 2,532
Code tags enforcer Team Colleague Featured Poster
cassyjack 0
Light Poster
peter_budo 2,532
Code tags enforcer Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.