It will make it easier for us to debug if you say more than:
"...but it doesn't seem work."
Roy
"Deb" <dm_41weath@hotmail.com> wrote in message
news:eed3d8c.-1@webx.raydaftYaTP...
> Hi, I was wondering if anyone could help me define a deck of cards.
> The following is what I did, but it doesn't seem work. Please help
> me.
>
> cardint = [1:52];
> cardsym = [AH, 1H, 2H, 3H, 4H, 5H, 6H, 7H, 8H, 9H, 10H, JH, QH, KH,
> AD, 1D, 2D, 3D, 4D, 5D, 6D, 7D, 8D, 9D, 10D, JD, QD, KD, AS, 1S, 2S,
> 3S, 4S, 5S, 6S, 7S, 8S, 9S, 10S, JS, QS, KS, AC, 1C, 2C, 3C, 4C, 5C,
> 6C, 7C, 8C, 9C, 10C, JC, QC, KC];
>
> for(i = 1:13)
> switch i
> case 1
> x = 'A';
> case 2
> x = '2';
> case 3
> x = '3';
> case 4
> x = '4';
> case 5
> x = '5';
> case 6
> x = '6';
> case 7
> x = '7';
> case 8
> x = '8';
> case 9
> x = '9';
> case 10
> x = '10';
> case 11
> x = 'J';
> case 12
> x = 'Q';
> case 13
> x = 'K';
> otherwise
> x = num2str(i);
> end
> end
> for j = 1:4
> switch j
> case 1
> y = 'H';
> case 2
> y = 'D';
> case 3
> y = 'S';
> case 4
> y = 'C';
> otherwise
> y = num2str(j);
> end
> end
> cardsymbol((j-1)*13 + i) = strcat(x,y)
|