Beispiel #1
0
        private int GetBestMaskPattern()
        {
            int num    = 0;
            int result = 0;

            for (int i = 0; i < 8; i++)
            {
                this.Make(true, i);
                int lostPoint = QRUtil.GetLostPoint(this);
                if (i == 0 || num > lostPoint)
                {
                    num    = lostPoint;
                    result = i;
                }
            }
            return(result);
        }
Beispiel #2
0
        private int GetBestMaskPattern()
        {
            int minLostPoint = 0;
            int pattern      = 0;

            for (int i = 0; i < 8; i++)
            {
                Make(true, i);
                int lostPoint = QRUtil.GetLostPoint(this);

                if (i == 0 || minLostPoint > lostPoint)
                {
                    minLostPoint = lostPoint;
                    pattern      = i;
                }
            }

            return(pattern);
        }