+ 8

War Card Game

I'm thinking about making the card game war in java. I was thinking about how to represent a deck of cards. Should I have one array with all the cards in it, or should I make two arrays, one with the suit and the other with the number? Any suggestions on this or on how to go about coding it are welcome. ;)

16th Feb 2017, 1:45 AM
J.G.
J.G. - avatar
10 odpowiedzi
16th Feb 2017, 2:43 AM
Tristan McCullen
Tristan McCullen - avatar
+ 6
@J.G. A few links to consider. Might help you get a clue on the base classes, arrays and structure in general: http://nifty.stanford.edu/2004/EstellCardGame/code.html# A full tutorial even for the average: http://www.dreamincode.net/forums/topic/116864-how-to-make-a-poker-game-in-java/
16th Feb 2017, 2:59 AM
Tristan McCullen
Tristan McCullen - avatar
+ 5
right! my bad! java offers fantastic oop so that shouldn't be a prob. :)
16th Feb 2017, 2:38 AM
Tristan McCullen
Tristan McCullen - avatar
+ 5
I tried it and got python...
16th Feb 2017, 2:46 AM
J.G.
J.G. - avatar
+ 4
Ahh... I didn't think of that. It will be interesting to try. Thank you for the suggestion. ;)
16th Feb 2017, 2:29 AM
J.G.
J.G. - avatar
+ 4
@Tristan I am not an HTML programmer, which is one of the reasons why everything you say is confusing to me. But I understand that, so okay. It would be better to do it in that instead of in java, but I just wanted to make something a little more difficult and have it record (output) the results.
16th Feb 2017, 2:34 AM
J.G.
J.G. - avatar
+ 4
Thanks for all of the help. I'm getting pretty busy right now, so it may be a while before I get back to you.
17th Feb 2017, 2:36 AM
J.G.
J.G. - avatar
+ 3
I'd create class "Card" with fields like, "color", "number" and "suit". Then create "Player" class which includes array of Cards objects. Hope it helped ^^
16th Feb 2017, 2:00 AM
Jakub Stasiak
Jakub Stasiak - avatar
+ 3
That's why I'm learning it (or one of the reasons)
16th Feb 2017, 2:42 AM
J.G.
J.G. - avatar
0
The War card game is simple and easy to play, which makes it a good option for casual sessions or teaching someone new to card games. In Thailand https://melbet-thailand.net people who enjoy card-based gameplay sometimes also try platforms like Melbet, an online casino that includes various card games among its offerings.It's always best to play responsibly and set clear limits when using any online service.
19th Jun 2025, 2:44 PM
BoonmeeSukjai