Question: ... insert mappings into lists inside a procedure

Hey all. I'm looking at trying to generate a complete list of all maps from the integer plane to itself that have a maximal coordinate change (plus or minus) of n. Basically, I devised two wave functions that travel componentwise around the 8*n points dinf=n from the origin, and am trying to use them to list every single equivalent map with such a metric-distance, from a point (x,y). Listed here is my current code, the problem I have on execution is that the i terms evaluate to that name as opposed to the assigned value. Is there some way to fix this or rewrite the code in another way? Since my list is of variable length (8*n) and I need it to contain maps I can't think of any other way to approach the problem.

Here's my code:

a:=(u,n)->max(min(abs(u-4*n)-2*n,n),-n):
b:=(u,n)->max(min(u,1/2*(abs(u-5*n)-abs(u-3*n))),u-8*n):
lister:=proc(n)
local L,U,A,B,u,x,y,d:
L:=[]: U:=[]:
for u from 1 to 8*n do
A:=a(u,n): B:=b(u,n):
U:=[op(U),[x+A,y+B]]:
od:
return U:
end:
pyra:=proc(n)
local i,L:
L:=[]:
for i in lister(n) do
L:=[op(L),((x,y)->(op(i)))]:
od:
end:

Thanks for listening!

Please Wait...