December 30th, 2012, 12:19 PM
Help with inputs
I've just started learning the C programming language at uni and am in need of some help.
If I have a input such as "3H 6S KH 7D AC"
Is there a way to group the second and first terms in the input e.g
First terms= 3,6,K,7,A
Second terms= H,S,H,D,C
Also is there a way to give the letters numerical values within the source code such as
Any help would be appreciate my knowledge of C is very basic
December 30th, 2012, 04:50 PM
Assign numeric value to card representation.
if (('2' <= CARD) && (CARD <= '9')) VALUE = CARD - '2';
else if ('T' == CARD) VALUE = 8;
else if ('J' == CARD) VALUE = 9;
else if ('Q' == CARD) VALUE = 10;
else if ('K' == CARD) VALUE = 11;
else if ('A' == CARD) VALUE = 12;
[/code] are essential for python code and Makefiles!