Hi all, I am new to C# and new to this forum. Decided to learn c# two months ago and started with Beginning Visual C#2010. Didnt need any help till now. Maybe its really simple, but I just dont see it. I just dont get the following in bold (the 13 at least makes sence, feeling whise, since there are 13 cards per suit, but I really cant place the -1):
Code:
public class Deck
{
private Card[] cards;
public Deck()
{
cards = new Card[52];
for (int suitVal = 0; suitVal < 4; suitVal++)
{
for (int rankVal = 1; rankVal < 14; rankVal++)
{
cards[suitVal * 13 + rankVal -1] = new Card((Suit)suitVal,
(Rank)rankVal);
}
}
}
I could also a check up so could everyone be so kind to explain what happens line by line and put special focus on the part in bold? Much appreciated.
Hvdl47