static void Main(string[] args) { Combination<int, string> winningCombination = new Combination<int, string>(1, 2, 3, "a", "b", "c"); Combination<int, string> newCombination = new Combination<int, string>(1, 2, 3, "a", "c", "b"); LottoGame<int, string> obj = new LottoGame<int, string>(winningCombination); obj.AddUserCombination(newCombination); LottoResult<int, string> obj1 = new LottoResult<int, string>(winningCombination, newCombination); }
public bool NextDrawHasOnlyOneNumberFromPrevious(LottoResult previousDraw, LottoResult nextDraw) { var next = new List<int>() { nextDraw.NUM1, nextDraw.NUM2, nextDraw.NUM3 }; var one = next.Count(x => x == previousDraw.NUM1); var two = next.Count(x => x == previousDraw.NUM2); var three = next.Count(x => x == previousDraw.NUM3); return one + two + three == 1; }