I am creating a game which composed of 6 cards, I want to make a combination of those cards but the problem is that I am stuck in creating that function. Below are the codes I made
public class Cards
{
public int number{ get; set; }
public string symbol{ get; set; }
public Cards(int number, string symbol)
{
number= Number;
symbol = Symbol;
}
}
//populate list
List<Cards> CardList = new List<Cards>();
void InitCards()
{
CardList.Add(new Cards(1, "dogman"));
CardList.Add(new Cards(2, "dogman"));
CardList.Add(new Cards(1, "catman"));
CardList.Add(new Cards(2, "catman"));
CardList.Add(new Cards(1, "birdman"));
CardList.Add(new Cards(2, "birdman"));
}
void MakeCombination()
{
foreach (var card in CardList)
{
//make combination
}
}
My expected output is to get all the possible combination with a set of two cards sample expected output below
1 dogman, 2 dogman
1 dogman, 1 catman
1 catman, 2 birdman