Welcome Guest, Not a member yet? Register   Sign In
Solitaire in c programming
#1

[eluser]Unknown[/eluser]
Code:

#include <stdio.h>
#include <conio.h>
#include <time.h>
#include <conio.c>

this thing only do is generate the number:

int random(int x)
{
srand((int) time(NULL));
return 1 + rand() % x;
}

and this, the colors:
void cardcolr(int naipe,int cardwcolr)
{
if (naipe == 1) // Hearts
{
switch(cardwcolr)
{
case 1:
textcolor(LIGHTRED);
printf(" A\3");
break;
case 11:
textcolor(LIGHTRED);
printf(" J\3");
break;
case 12:
textcolor(LIGHTRED);
printf(" Q\3");
break;
case 13:
textcolor(LIGHTRED);
printf(" K\3");
break;
default:
textcolor(LIGHTRED);
printf(" %d\3",cardwcolr);
}
}
if (naipe == 2) // Spades
{
switch(cardwcolr)
{
case 1:
textcolor(BLACK);
printf(" A\6");
break;
case 11:
textcolor(BLACK);
printf(" J\6");
break;
case 12:
textcolor(BLACK);
printf(" Q\6");
break;
case 13:
textcolor(BLACK);
printf(" K\6");
break;
default:
textcolor(BLACK);
printf(" %d\6",cardwcolr);
}
}
if (naipe == 3) // Diamonds
{
switch(cardwcolr)
{
case 1:
textcolor(LIGHTRED);
printf(" A\4");
break;
case 11:
textcolor(LIGHTRED);
printf(" J\4");
break;
case 12:
textcolor(LIGHTRED);
printf(" Q\4");
break;
case 13:
textcolor(LIGHTRED);
printf(" K\4");
break;
default:
textcolor(LIGHTRED);
printf(" %d\4",cardwcolr);
}
}
if (naipe == 4) // Clubs
{
switch(cardwcolr)
{
case 1:
textcolor(BLACK);
printf(" A\5");
break;
case 11:
#2

[eluser]TheFuzzy0ne[/eluser]
Taken from the home page:

Quote:CodeIgniter is a powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications. If you're a developer who lives in the real world of shared hosting accounts and clients with deadlines, and if you're tired of ponderously large and thoroughly undocumented frameworks

Hope this helps.
#3

[eluser]huzzi[/eluser]
spam spam




Theme © iAndrew 2016 - Forum software by © MyBB