Esempio n. 1
0
        public void ScoreBitShiftNegScore()
        {
            var commandNo = (byte)8;
            var legal     = false;
            var check     = false;
            var score     = -1000;
            var scoreInfo = ScoreInfo.DrawByRepetion | ScoreInfo.StaleMate;
            var depth     = 1;
            var build     = PositionsDatabase.Pack(commandNo, legal, check, score, scoreInfo, depth);

            PositionsDatabase.Unpack(build, out byte oCommandNo, out bool oLegal, out bool oCheck, out ScoreInfo oScoreInfo, out int oScore, out int oDepth);

            Assert.AreEqual(commandNo, oCommandNo);
            Assert.AreEqual(legal, oLegal);
            Assert.AreEqual(score, oScore);
            Assert.AreEqual(scoreInfo, oScoreInfo);
            Assert.AreEqual(depth, oDepth);
        }
Esempio n. 2
0
        public void ScoreBitShiftMax()
        {
            var  commandNo = (byte)127;
            var  legal     = true;
            bool check     = true;
            var  score     = 8190;
            var  scoreInfo = ScoreInfo.DrawByRepetion | ScoreInfo.StaleMate | ScoreInfo.Mate | ScoreInfo.InsufficientMaterial;
            var  depth     = 31;
            var  build     = PositionsDatabase.Pack(commandNo, legal, check, score, scoreInfo, depth);

            PositionsDatabase.Unpack(build, out byte oCommandNo, out bool oLegal, out bool oCheck, out ScoreInfo oScoreInfo, out int oScore, out int oDepth);

            Assert.AreEqual(commandNo, oCommandNo);
            Assert.AreEqual(legal, oLegal);
            Assert.AreEqual(check, oCheck);
            Assert.AreEqual(score, oScore);
            Assert.AreEqual(scoreInfo, oScoreInfo);
            Assert.AreEqual(depth, oDepth);
        }
Esempio n. 3
0
        public void ScoreBitShift1()
        {
            var commandNo = (byte)124;
            var legal     = true;
            var check     = true;
            var score     = (short)8100;
            var scorInfo  = ScoreInfo.Mate | ScoreInfo.InsufficientMaterial;
            var depth     = 12;
            var build     = PositionsDatabase.Pack(commandNo, legal, check, score, scorInfo, depth);

            PositionsDatabase.Unpack(build, out byte oCommandNo, out bool oLegal, out bool oCheck, out ScoreInfo oScoreInfo, out int oScore, out int oDepth);

            Assert.AreEqual(oCommandNo, commandNo);
            Assert.AreEqual(oLegal, legal);
            Assert.AreEqual(check, oCheck);
            Assert.AreEqual(oScore, score);
            Assert.AreEqual(oScoreInfo, scorInfo);
            Assert.AreEqual(oDepth, depth);
        }
Esempio n. 4
0
        public void ScoreBitShiftZero()
        {
            var commandNo = (byte)0;
            var legal     = false;
            var check     = false;
            var score     = 0;
            var scoreInfo = (ScoreInfo)0;//ScoreInfo.DrawByRepetion | ScoreInfo.StaleMate;
            var build     = PositionsDatabase.Pack(commandNo, legal, check, score, scoreInfo);

            byte      oCommandNo;
            bool      oLegal;
            bool      oCheck;
            ScoreInfo oScoreInfo;
            int       oScore;

            PositionsDatabase.Unpack(build, out oCommandNo, out oLegal, out oCheck, out oScoreInfo, out oScore);

            Assert.AreEqual(commandNo, oCommandNo);
            Assert.AreEqual(legal, oLegal);
            Assert.AreEqual(check, oCheck);
            Assert.AreEqual(score, oScore);
            Assert.AreEqual(scoreInfo, oScoreInfo);
        }