RosettaCodeData/Task/Identity-matrix/Phix/identity-matrix.phix
2017-09-25 22:28:19 +02:00

13 lines
232 B
Text

function identity(integer n)
sequence res = repeat(repeat(0,n),n)
for i=1 to n do
res[i][i] = 1
end for
return res
end function
ppOpt({pp_Nest,1})
pp(identity(3))
pp(identity(5))
pp(identity(7))
pp(identity(9))