dlemstra / dlemstra/QRCodeCore

Lack patten methods in MaskPattern, won't work

Open
#3 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
24
Forks
10
PR merge metrics
No merged PRs in 30d

Description

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)
{
\\ ...
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.