private void BuildChain(List <ChipChain> chains, List <Chip> remainingChips, ChipChain possibleChain)
        {
            List <Chip> nextChips = remainingChips.Where(c => c.LeftColor == possibleChain.Last().RightColor).ToList();

            foreach (Chip nextChip in nextChips)
            {
                List <Chip> proxyRemainingChips = new List <Chip>(remainingChips);
                ChipChain   proxyPossibleChain  = new ChipChain(possibleChain);

                proxyRemainingChips.Remove(nextChip);
                proxyPossibleChain.Add(nextChip);

                if (!proxyRemainingChips.Any())
                {
                    chains.Add(proxyPossibleChain);
                }
                else
                {
                    BuildChain(chains, proxyRemainingChips, proxyPossibleChain);
                }
            }
        }
        public List <ChipChain> BuildChains(Chip headChip, List <Chip> remainingChips)
        {
            List <ChipChain> chains = new List <ChipChain>();

            ChipChain possibleChain = new ChipChain()
            {
                headChip
            };

            if (!remainingChips.Any())
            {
                chains.Add(possibleChain);
            }
            else
            {
                List <Chip> nextChips = remainingChips.Where(c => c.LeftColor == possibleChain.Last().RightColor).ToList();
                foreach (Chip nextChip in nextChips)
                {
                    List <Chip> proxyRemainingChips = new List <Chip>(remainingChips);
                    ChipChain   proxyPossibleChain  = new ChipChain(possibleChain);

                    proxyRemainingChips.Remove(nextChip);
                    proxyPossibleChain.Add(nextChip);

                    if (!proxyRemainingChips.Any())
                    {
                        chains.Add(proxyPossibleChain);
                    }
                    else
                    {
                        BuildChain(chains, proxyRemainingChips, proxyPossibleChain);
                    }
                }
            }

            return(chains);
        }