/// <summary> /// Verifies if the next segment should be removed because maybe the next one has equal values from the current, so, removing the next one can create a bigger segment. /// </summary> /// <param name=""></param> /// <param name="LargeSegmentIndex"></param> /// <returns></returns> static bool ShouldRemoveThenNextSegement(List <Segments> list, int LargeSegmentIndex, Segments LargerSegment) { //Avoid the out of Bounds if (LargeSegmentIndex + 2 < list.Count) { //If yes, remove the CurrentSegment+1. Check if the next 2 segement is equal to the current if (list[LargeSegmentIndex + 2].numbers.Contains(LargerSegment.numbers[0])) { return(true); } else { return(false); } } else { return(false); } }
/// <summary> /// According with the rule, if on segment has X of length, the total points will be X*X /// </summary> /// <param name="segment"></param> /// <returns></returns> static int CalculatePoints(Segments segment) { return(segment.numbers.Count * segment.numbers.Count); }