Esempio n. 1
0
        public void resultat()
        {
            switch (monDernierCoup.CompareWith(oppLastMove))
            {
            default:
            case 0:
                egaux          += 1;
                egauxSuivis    += 1;
                defaitesSuivis  = 0;
                victoiresSuivis = 0;
                break;

            case 1:
                victoire        += 1;
                victoiresSuivis += 1;
                defaitesSuivis   = 0;
                egauxSuivis      = 0;
                break;

            case -1:
                defaite        += 1;
                defaitesSuivis += 1;
                egauxSuivis     = 0;
                victoiresSuivis = 0;
                break;
            }
        }
Esempio n. 2
0
        private int CheckWin(Move move)
        {
            switch (move.CompareWith(i))
            {
            case 0:
                break;

            case 1:
                return(1);

            case -1:
                return(0);
            }
            return(0);
        }
Esempio n. 3
0
        private int CheckWin()
        {
            switch (c.CompareWith(b))
            {
            case 0:
                return(0);

            case 1:
                return(1);

            case -1:
                return(-1);

            default:
                return(1);
            }
        }
Esempio n. 4
0
        public override Move Play()
        {
            d.Sort((a, b) => (a.Name.CompareTo(b.Name)));

            if (b.Count < 4)
            {
                b.Add(i);
            }
            else
            {
                c.Add(b);
                b.Clear();
                b.Add(i);
                g = 0;
            }
            if (g == 4)
            {
                g = 3;
            }



            switch (r.CompareWith(i))
            {
            case 0:
                break;

            case 1:
                e++;
                break;

            case -1:
                f++;
                break;
            }
            h = Advisers();
            d.Sort((a, b) => (a.Name.CompareTo(b.Name)));


            g++;
            r = h;
            return(h);
        }
Esempio n. 5
0
        private int CheckWin()
        {
            switch (myMove.CompareWith(oppNextMove))
            {
            case 0:
                //tieCount++;
                return(0);

            case 1:
                //winCount++;
                return(1);

            case -1:
                //loseCount++;
                return(-1);

            default:
                return(1);
            }
        }
Esempio n. 6
0
        public override Move Play()
        {
            aILeaderboards.Sort((a, b) => (a.Name.CompareTo(b.Name)));
            EnnemyMoves.Add(opMove);
            if (turns > 1)
            {
                beforeOpMove = EnnemyMoves[EnnemyMoves.Count - 2];
            }

            if (moves.Count < 4)
            {
                moves.Add(opMove);
                listMove.Add(moves);
            }
            else
            {
                listMove.Add(moves);
                moves.Clear();
                moves.Add(opMove);
                index = 0;
            }
            if (index == 4)
            {
                index = 3;
            }

            //FELIX
            switch (myLastMove.CompareWith(opMove))
            {
            case 0:
                draw++;
                break;

            case 1:
                wins++;
                break;

            case -1:
                loses++;
                break;
            }


            overRuleMove = Advisers();

            aILeaderboards.Sort((a, b) => (a.Wins.CompareTo(b.Wins)));

            index++;

            myLastMove = overRuleMove;



            turns++;
            //if (turns == 100)
            //{
            //    Console.WriteLine("won : " + wins + ", lost : " + loses + ", draws : " + draw);
            //    aILeaderboards.Sort((a, b) => (a.Wins.CompareTo(b.Wins)));
            //    foreach (var item in aILeaderboards)
            //    {
            //        Console.WriteLine(" algorithm name : " + item.Name + ", algorithm wins :" + item.Wins);
            //    }

            //    Console.WriteLine("_________________________________________________________________________________________" + aILeaderboards[aILeaderboards.Count - 1].Name + "--- " + " ---");
            //}
            ////Console.WriteLine(" my move " +overRuleMove + " his last " + opMove);
            myPlays.Add(overRuleMove);
            return(overRuleMove);
        }