예제 #1
0
 public static void Set(string number)
 {
     TahminDizisi = Guess.Shuffling(number);
 }
예제 #2
0
 public ItemDetailViewModel(Guess item = null)
 {
     Number      = item?.number;
     ValueString = item?.valueString;
     Item        = item;
 }
예제 #3
0
        static string Yerleştir(Guess guess, string _newNumber_)
        {
            Guess guessCopy = guess.Extract(_newNumber_);

            if (guessCopy == null)
            {
                //Fazla yerleşmiş
                return(null);
            }
            int           j, k;
            char          c;
            StringBuilder newNumber   = new StringBuilder(_newNumber_);
            StringBuilder guessNumber = new StringBuilder(guessCopy.number);

            newNumber.FindSpaces();

            for (int i = 0; i < guessCopy.arti; ++i)
            {
                do
                {
                    j = newNumber.NextSpace();
                    if (j == -1)
                    {
                        return(null);
                    }
                    c = guessNumber[j];
                    if (c == ' ')
                    {
                        continue;
                    }
                } while (redlist.ToString().IndexOf(c) > -1);

                newNumber[j]   = guessNumber[j];
                guessNumber[j] = ' ';
            }
            guessNumber.FindChars();
            for (int i = 0; i < guessCopy.eksi; ++i)
            {
dön:
                do
                {
                    k = guessNumber.NextChar();
                    if (k == -1)
                    {
                        return(null);
                    }
                    c = guessNumber[k];
                } while (redlist.ToString().IndexOf(c) > -1);

                newNumber.FindSpaces();
                for (;;)
                {
                    j = newNumber.NextSpace();
                    if (j == -1)
                    {
                        goto dön;
                    }
                    if (guess.number.Length == 4 && j == k)
                    {
                        continue;
                    }
                    if (c == '0' && j == 0)
                    {
                        continue;
                    }
                    break;
                }
                newNumber[j]   = c;
                guessNumber[k] = ' ';
            }
            redlist.Append(guessNumber.RemoveWhitespace());
            return(newNumber.ToString());
        }