import util::Math; import List; import Set; import IO; alias cd = tuple[int,int]; public rel[cd, int] zz(int n){ indexorder = sort([| x <- [0..n], y <- [0..n]], bool (cd a, cd b){ if (a[0]+a[1] > b[0]+b[1]) return false; elseif(a[0] < b[0]) return false; else return true; ; }); return { | z <- index(indexorder)}; } public void printzz(rel[cd, int] myarray){ n = floor(sqrt(size(myarray))); for (x <- [0..n-1]){ for (y <- [0..n-1]){ print("]>\t");} println();} }