Beispiel #1
0
        public bool LowAIGuess()
        {
            List <int> _tmp    = StackP.CatchUnpassCheese();
            var        _parent = (((this.Parent as Canvas).Parent as Grid).Parent as Class.DavinciCodePlay);

            int guessnum    = (_parent as Class.DavinciCodePlay).ran.Next(13);
            int CatchCheese = _tmp[(_parent as Class.DavinciCodePlay).ran.Next(_tmp.Count)];

            (StackP.MainSP.Children[CatchCheese] as Class.Cheese).Guess_in();
            addnum(CatchCheese, guessnum);

            DispatcherTimer timer = new DispatcherTimer();

            timer.Interval = new TimeSpan(0, 0, 0, 0, 100);
            timer.Tick    += new EventHandler(timer_Tick);
            timer.Start();

            if (guessnum == (StackP.MainSP.Children[CatchCheese] as Class.Cheese).IconIndex)
            {
                (StackP.MainSP.Children[CatchCheese] as Class.Cheese).Pass = true;
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #2
0
        public void AIGuessWrong(/*UIElement uIElement*/)
        {
            List <int> _tmp = StackP.CatchUnpassCheese();
            //(uIElement as Cheese).Pass = true;
            Random Ran = new Random();
            int    a   = _tmp[Ran.Next(_tmp.Count)];

            (StackP.MainSP.Children[a] as Class.Cheese).Pass  = true;
            (StackP.MainSP.Children[a] as Class.Cheese).Opera = true;
        }