Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- declare function local:build-cells($x, $y)
- {
- for $num in 1 to fn:count($x)
- return
- [$x[$num] , $y[$num]]
- };
- declare function local:build-grid($x, $y) {
- (local:build-cells($x, $y),
- local:build-cells($y, $x),
- local:build-cells($x, $y),
- local:build-cells($y, $x),
- if ($x = [1, 1] and $y = [1, 0])
- then
- ()
- else
- local:build-grid(
- ($x ! (. - 1))[position() = 1 to (($x[1] - 1) * 2)],
- (($y)[position() = 2 to ($y[last()] + $y[1])])
- )
- )
- };
- let $seq :=
- fn:reverse(local:build-grid((for $i in 1 to 800
- return
- 400), (fn:reverse((for $i in 0 to 399
- return
- $i)),
- for $i in 1 to 400
- return
- $i)))
- return $seq[361527](1) + $seq[361527](2)
Add Comment
Please, Sign In to add comment