5 lines
96 B
Raku
5 lines
96 B
Raku
sub identity-matrix($n) {
|
|
my @id = [0 xx $n] xx $n;
|
|
@id[$_][$_] = 1 for ^$n;
|
|
@id;
|
|
}
|