Commit 1f732f58 authored by Nathan/Eilisha Shiraini's avatar Nathan/Eilisha Shiraini
Browse files

Implemented the finder pattern generation

parent 2b44cf59
......@@ -95,3 +95,11 @@ def layoutModeMessage(matrix, message, layers, compact):
layout = [(pos[0] + centerPos, pos[1] + centerPos) for pos in (MODE_LAYOUT_COMPACT if compact else MODE_LAYOUT_FULL)]
for i, bit in enumerate(message):
matrix[layout[i]] = bit
def layoutFinder(matrix, layers, compact):
size = ps.matrixSize(layers, compact)
centerPos = size // 2
finderSize = 4 if compact else 6
for i in range(finderSize):
for j in range(finderSize):
matrix[i + centerPos, j + centerPos] = max(i, j) % 2 == 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment