Skip to content

Lack patten methods in MaskPattern, won't work #3

@zzxxhhzxh

Description

@zzxxhhzxh

In the MaskPattern Class, there is no patten method.
Should add these patten methods, which are copied from QRCode:

private static class MaskPattern
{
    public static bool Pattern1(int x, int y)
    {
        return (x + y) % 2 == 0;
    }

    public static bool Pattern2(int x, int y)
    {
        return y % 2 == 0;
    }

    public static bool Pattern3(int x, int y)
    {
        return x % 3 == 0;
    }

    public static bool Pattern4(int x, int y)
    {
        return (x + y) % 3 == 0;
    }

    public static bool Pattern5(int x, int y)
    {
        return ((int)(Math.Floor(y / 2d) + Math.Floor(x / 3d)) % 2) == 0;
    }

    public static bool Pattern6(int x, int y)
    {
        return ((x * y) % 2) + ((x * y) % 3) == 0;
    }

    public static bool Pattern7(int x, int y)
    {
        return (((x * y) % 2) + ((x * y) % 3)) % 2 == 0;
    }

    public static bool Pattern8(int x, int y)
    {
        return (((x + y) % 2) + ((x * y) % 3)) % 2 == 0;
    }

    public static int Score(ref QRCodeMatrix qrCode)
    {
        \\ ...
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions