LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-25-2003, 06:10 AM   #1
FredrikN
Member
 
Registered: Nov 2001
Location: Sweden
Distribution: GNU/Linux since -97
Posts: 149

Rep: Reputation: 15
Game cards


Hi, I'm writing a simple poker game i Java.

I would like to use ASCII cards as well, but I can't find it anywhere :-(

Maybe someone here know where I cant find it, been searching for it some hours now

Thanks
 
Old 01-29-2003, 01:42 AM   #2
GtkUser
Member
 
Registered: Sep 2002
Location: Canada
Distribution: Redhat 9.0
Posts: 637

Rep: Reputation: 30
I have the answer in C. I think it's:

Code:
struct card_t
{
  int suit, face;
};

struct card_t cards[52]; //deck of cards

int i, k, j = 0;

for( i = 3; i <= 6; ++i)
{
  for( k = 2; k <= 14; ++k)
  {
    cards[j].face = k;
    cards[j++].suit = i;
  }
}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
will you play windows game or linux native game pleasehelpme Linux - Newbie 16 04-29-2007 08:58 PM
2D/3D Game EASY Game Development Software tedjordan Linux - Games 1 03-22-2005 06:40 AM
Firewire pci cards/pcmcia cards bunyan Red Hat 0 03-03-2005 04:45 PM
game not receving game list from master server Rnastyracer Linux - Games 2 04-02-2004 10:20 PM
formatting multimedia cards, flash cards bigearsbilly Linux - Hardware 0 03-10-2004 08:52 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration