Example #1
0
        public static bool Check25W(string mapnumber25W)
        {
            if (string.IsNullOrEmpty(mapnumber25W) || !mapnumber25W.Contains("-") || !mapnumber25W.Contains("[") || !mapnumber25W.Contains("]"))
            {
                return(false);
            }
            string[] split = mapnumber25W.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries);
            if (split.Length != 3 || !Mapnumber100W.ValidateRowNum(split[0]) || !Mapnumber100W.ValidateColumnNum(split[1]))
            {
                return(false);
            }
            string k = split[2];

            string[] subSplit = k.Split(new char[] { '[', ']' }, StringSplitOptions.RemoveEmptyEntries);
            int      len      = subSplit.Length;

            if (len != 1)
            {
                return(false);
            }
            int sum = OldMapnumber.SumCount(OldMapnumberDefine.MaxCount25W);

            string[] strs = OldMapnumber.AllAllowedNums(sum);
            return(MapnumberCommon.Contain(strs, subSplit[0]));
        }
Example #2
0
        public static bool Check1W(string mapnumber1W)
        {
            if (string.IsNullOrEmpty(mapnumber1W) || !mapnumber1W.Contains("-") || !mapnumber1W.Contains("(") || !mapnumber1W.Contains(")"))
            {
                return(false);
            }
            string[] split = mapnumber1W.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries);
            if (split.Length != 4)
            {
                return(false);
            }
            string o10W = split[0] + "-" + split[1] + "-" + split[2];

            if (!Check10W(o10W))
            {
                return(false);
            }
            string k = split[3];

            string[] subSplit = k.Split(new char[] { '(', ')' }, StringSplitOptions.RemoveEmptyEntries);
            if (subSplit.Length != 1)
            {
                return(false);
            }
            string sub = subSplit[0];
            int    sum = OldMapnumber.SumCount(OldMapnumberDefine.MaxCount1W);

            string[] strs = OldMapnumber.AllAllowedNums(sum);
            return(MapnumberCommon.Contain(strs, sub));
        }