XLnTz
✅ Need Help, Basic "lottery game"
Hello! im studying C# and got this project to make a "lottery game" that i have to complete until tomorrow and i cant get Matching number part to work.
i need to Compare matching numbers from user and random and Print out users Numbers, Random Numbers and the matching numbers saying "Bingo Numbers: " and how many numbers are matching.
Can anyone tell me how to make it work or guide how to add the matching numbers of users Array input and random numbers List?
Here's the part if its any help (To much text with the whole code)
//New list for Matching nr
List<int> matchNum = new List<int>();
Console.WriteLine();
Console.Write("Bingo Numbers: ");
//Loop to compare and add matching nr to matchNum and print each matching number as "Bingo"
foreach (int num in rndList)
{
if (rndList.Contains(num))
{
matchNum.Add(iNum);
}
if (matchNum.Count > 0)
{
Console.Write(matchNum.Count + ", ");
}
81 replies