private void CalculateResults() { int[] comboCount = new int[_combos.Count]; for (int i = 0; i < _reshuffleAmount; i++) { List <int> randomHand = Decklist.rand(_deckMain).GetRange(0, handSize); bool firstFound = true; for (int j = 0; j < _combosIds.Count; j++) { bool resultFound = false; List <int> combo = _combosIds[j]; if (ListComparer.ContainsAllItems(randomHand, combo)) { resultFound = true; comboCount[j]++; if (firstFound) { _globalCombosCount++; firstFound = false; } } List <Card> randomHandCard = new List <Card>(); foreach (var c in randomHand) { randomHandCard.Add(CardsManager.GetCard(c)); } logs.Add($"Hand number {i.ToString()} Combo number: {j.ToString()} Found combo: {resultFound} Combo: {string.Join(", ", _combos[j])} Hand: {string.Join(", ", randomHandCard)}"); } } for (int j = 0; j < _combosIds.Count; j++) { logs.Add($"\nResult for Combo{j.ToString()} is: {comboCount[j].ToString()}\n"); } for (int i = 0; i < _combos.Count; i++) { DisplayResults(_combos[i], comboCount[i]); } decimal percentage = GetPercentage(_globalCombosCount, _reshuffleAmount); amountLabel.Text = $"{_globalCombosCount.ToString()} out of {_reshuffleAmount} hands = {percentage.ToString()}%"; LastComboLogFileName = $"ComboLogs_{_deckName}_{DateTime.Now.ToString("yyyyMMddTHHmmss")}.txt"; try { if (!Directory.Exists(_logsFolder)) { Directory.CreateDirectory(_logsFolder); } File.WriteAllLines(Path.Combine(_logsFolder, LastComboLogFileName), logs); } catch { MessageBox.Show("The app experienced issues exporting logs into the folder.", "Error saving logs to the logs folder", MessageBoxButtons.OK, MessageBoxIcon.Error); } logs.Clear(); }