예제 #1
0
 private bool sdf(cla mnmnmn)
 {
     if (mnmnmn.b() || mnmnmn.a() || mnmnmn.c())
     {
         return(true);
     }
     return(false);
 }
예제 #2
0
파일: LiorPlayer.cs 프로젝트: LiorPe/AIGame
        private bool sdf(cla mnmnmn)
        {
            if (mnmnmn.b() || mnmnmn.a() || mnmnmn.c())
            {
                return true;
            }
            return false;



        }
예제 #3
0
        public void CopyToObjectWithoutCacheTest3()
        {
            // Входные параметры: новые объекты классов cla и clb.
            var b = new cla();
            var a = new clb();

            b.info = "tada";
            a.ref2 = b;
            a.ref1 = b;

            STORMNET.DataObject copy = null;
            a.CopyToObjectWithoutCache(ref copy, true, true);

            // Ожидаемый результат: эквивалентность свойства info у исходных ископированных объекьтов.
            Assert.Equal("tada", ((clb)copy).ref1.info);
            Assert.Equal("tada", ((clb)copy).ref2.info);
        }
예제 #4
0
파일: LiorPlayer.cs 프로젝트: LiorPe/AIGame
 public Tuple<int, int> playYourTurn
 (
     Board board,
     TimeSpan timesup
 )
 {
     StartStopWatch();
     _timesup = timesup;
     cla gffg = new cla(board);
     Tuple<int, int> nbnbnbnb = null;
     Stack<Tuple<int, int>> nbnbnb = gffg.foo();
     nbnbnbnb = vbvbvb(gffg, nbnbnb);
     if (nbnbnbnb == null)
         nbnbnbnb = gffg.nbnbnbnb();
     Console.WriteLine("{0} ms left", (_timesup - stopWatch.Elapsed).TotalMilliseconds);
     return nbnbnbnb;
 }
예제 #5
0
파일: LiorPlayer.cs 프로젝트: LiorPe/AIGame
            public cla(cla cvcvcvc, Tuple<int, int> vcvcvcvc)
            {
                _rows = cvcvcvc._rows;
                _cols = cvcvcvc._cols;
                _bbb = new Dictionary<int, int>();
                int bvvbvbvb = 0;
                for (; bvvbvbvb < _rows && bvvbvbvb < vcvcvcvc.Item1; bvvbvbvb++)
                    _bbb[bvvbvbvb] = cvcvcvc._bbb[bvvbvbvb];
                for (; bvvbvbvb < _rows; bvvbvbvb++)
                {
                    if (vcvcvcvc.Item2 == 0 || !cvcvcvc._bbb.ContainsKey(bvvbvbvb))
                    {
                        break;
                    }
                    else
                        _bbb[bvvbvbvb] = Math.Min(vcvcvcvc.Item2 - 1, cvcvcvc._bbb[bvvbvbvb]);
                }
                _aaa = Math.Max(0, bvvbvbvb - 1);

            }
예제 #6
0
파일: LiorPlayer.cs 프로젝트: LiorPe/AIGame
        private Tuple<int, int> vbvbvb(cla jkj, Stack<Tuple<int, int>> kjkjkjjk)
        {
            Tuple<int, int> kjkjkjkjkjdf;
            cla fhh;
            Dictionary<Tuple<int, int>, cla> jkjkkj = new Dictionary<Tuple<int, int>, cla>();
            while (!g() && kjkjkjjk.Count > 0)
            {
                kjkjkjkjkjdf = kjkjkjjk.Pop();
                fhh = new cla(jkj, kjkjkjkjkjdf);
                if (dfd(fhh))
                {
                    //Console.WriteLine("Gain: 1");
                    return kjkjkjkjkjdf;
                }
                jkjkkj[kjkjkjkjkjdf] = fhh;
            }
            int cghj = Int32.MinValue;
            int mbbb;
            Tuple<int, int> bmbbm = null;
            int bnbnb = 3;
            int gfgfgfgf = bnbnb;
            Tuple<int, int> bvcxvbvb;
            for (int i = 0; i < jkjkkj.Keys.Count; i++)
            {
                bvcxvbvb = jkjkkj.Keys.ElementAt(i);
                if (g())
                {
                    break;
                }
                fhh = jkjkkj[bvcxvbvb];

                if (stopWatch.Elapsed.TotalMilliseconds / _timesup.TotalMilliseconds < 0.3)
                {
                    bnbnb = d(bnbnb, ref gfgfgfgf, jkjkkj.Keys.Count - i, jkjkkj.Keys.Count, false, 4);

                }
                else
                {
                    bnbnb = d(bnbnb, ref gfgfgfgf, jkjkkj.Keys.Count - i, jkjkkj.Keys.Count, true, 4);
                }

                if (!sdf(fhh))
                    mbbb = d2(fhh, goo.foo, bnbnb, int.MinValue, int.MaxValue);
                else
                    mbbb = -1;
                if (mbbb > cghj)
                {
                    cghj = mbbb;
                    bmbbm = bvcxvbvb;

                    if (cghj == 1)
                    {

                        break;
                    }

                }

            }
            Console.WriteLine("Gain calculated: " + cghj);
            if (cghj <= 0)
            {
                return jkj.nbnbnbnb();
            }
            return bmbbm;
        }
예제 #7
0
파일: LiorPlayer.cs 프로젝트: LiorPe/AIGame
        private int d2(cla ser, goo fde, int ddf, int dfdf, int dfdd)
        {


            if (dfd(ser))
            {
                if (fde == goo.foo)
                    return 1;
                else
                    return -1;
            }
            if (sdf(ser))
            {
                if (fde == goo.foo)
                    return -1;
                else
                    return 1;
            }
            if (ddf == 0)
            {
                return 0;
            }

            int doo;
            int sh;
            goo shoo;
            if (fde == goo.foo)
            {
                shoo = goo.MinPlayer_Opponent;
                doo = int.MaxValue;
            }
            else
            {
                doo = int.MinValue;
                shoo = goo.foo;
            }
            Tuple<int, int> w;
            cla e;
            Dictionary<Tuple<int, int>, cla> f = new Dictionary<Tuple<int, int>, cla>();
            Stack<Tuple<int, int>> aq = ser.foo();
            while (!g() && aq.Count > 0)
            {
                w = aq.Pop();
                e = new cla(ser, w);

                f[w] = e;

                sh = d2(e, shoo, ddf - 1, dfdf, dfdd);
                if (shoo == goo.foo)
                {
                    doo = Math.Max(doo, sh);
                    dfdf = Math.Max(dfdf, sh);
                    if (doo >= dfdd || doo == 1)
                    {
                        //Console.WriteLine("Tree cutted at depth {0} by alpha beya pruning!", depthLevel);
                        break;
                    }
                }
                else
                {
                    doo = Math.Min(doo, sh);
                    dfdd = Math.Min(dfdd, sh);
                    if (doo <= dfdf || doo == -1)
                    {
                        //Console.WriteLine("Tree cut at depth {0} by alpha beya pruning!", depthLevel);
                        break;
                    }

                }
            }
            return doo;

        }
예제 #8
0
파일: LiorPlayer.cs 프로젝트: LiorPe/AIGame
 private bool dfd(cla pio)
 {
     return pio.f() || pio.e() || pio.d() || pio.g();
 }