use std.math; var mat = func(width,height) { var res=[]; setsize(res,width*height); forindex(var i;res) { res[i]=0; } return { width:width, height:height, mat:res }; } var rand_init = func(a) { var ref=a.mat; forindex(var i;ref) { ref[i]=rand()*2-1; } } var mat_print = func(a) { var (width,height,ref)=(a.width,a.height,a.mat); for(var i=0;i