Guest User

Untitled

a guest
Feb 25th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. declare function local:build-cells($x, $y)
  2. {
  3. for $num in 1 to fn:count($x)
  4. return
  5. [$x[$num] , $y[$num]]
  6. };
  7.  
  8. declare function local:build-grid($x, $y) {
  9. (local:build-cells($x, $y),
  10. local:build-cells($y, $x),
  11. local:build-cells($x, $y),
  12. local:build-cells($y, $x),
  13. if ($x = [1, 1] and $y = [1, 0])
  14. then
  15. ()
  16. else
  17. local:build-grid(
  18. ($x ! (. - 1))[position() = 1 to (($x[1] - 1) * 2)],
  19. (($y)[position() = 2 to ($y[last()] + $y[1])])
  20. )
  21. )
  22. };
  23.  
  24. let $seq :=
  25. fn:reverse(local:build-grid((for $i in 1 to 800
  26. return
  27. 400), (fn:reverse((for $i in 0 to 399
  28. return
  29. $i)),
  30. for $i in 1 to 400
  31. return
  32. $i)))
  33. return $seq[361527](1) + $seq[361527](2)
Add Comment
Please, Sign In to add comment