Awesome help from the c++ witch
Code:
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<windows.h>
using namespace std;
#define WHITE BACKGROUND_RED|BACKGROUND_GREEN|BACKGROUND_BLUE|BACKGROUND_INTENSITY
#define RED FOREGROUND_RED|FOREGROUND_INTENSITY
#define BLACK 0
typedef struct card
{
unsigned int face_value;
char suit;
card *next;
card(){next=NULL;}
}*mycard;
int main(void)
{
HANDLE hOut;
hOut = GetStdHandle(STD_OUTPUT_HANDLE);
mycard new_card = new card;
srand(GetTickCount());
new_card->face_value = static_cast<unsigned>(rand()%9+2);
new_card->suit = static_cast<char>(rand()%4+3);
SetConsoleTextAttribute(hOut, new_card->suit<5?WHITE|RED:WHITE|BLACK);
cout << new_card->face_value << new_card->suit << " \n"
<< " \n"
<< " " << new_card->suit << " \n"
<< " \n"
<< " " << new_card->suit << new_card->face_value;
return 0;
}
Although I couldn't figure out why the #defines where whacked.. I just put everything on a single line. Compile and run.. you'll get a descent looking playing card