def same.go
import bend-kit-archive@0.5.1.0/archive.bend as Archiveimport Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
75def same.go(n: Nat, r: Array<U32> & Bool, +x: U32, +y: U32) -> Array<U32> & Bool:
76 match n:
77 case 0n:
78 r
79 case 1n+q:
80 (a, ok) = r
81 match ok:
82 case False{}:
83 (a, False{})
84 case True{}:
85 same.go(q, same.at2(Bytes.peek(a, x), y), (x + 1 : U32), (y + 1 : U32))