Пример #1
0
        public bool IsDiagonalNumber(RDNumber n, RDBool result, object factPool)
        {
            FactPool pool = (FactPool)factPool;

            if (pool.isDiagnal[n.Data] == result.Data)
            {
                return(false);
            }
            pool.isDiagnal[n.Data] = result.Data;
            return(true);
        }
Пример #2
0
        public void SquareNumber(string name, Dictionary <string, RDElement> dict, object factPool, Rule rule, Action <int> callBack, int callBackID)
        {
            FactPool pool = (FactPool)factPool;

            for (int i = 0; i <= 1000; ++i)
            {
                if (pool.isSquare[i])
                {
                    dict[name] = new RDNumber(i);
                    callBack(callBackID);
                }
            }
            dict.Remove(name);
        }