RosettaCodeData/Task/Create-a-two-dimensional-ar.../Sidef/create-a-two-dimensional-ar...

11 lines
292 B
Plaintext

func make_matrix(x, y) {
y.of { x.of(0) };
}
var y = Sys.scanln("rows: ").to_i;
var x = Sys.scanln("cols: ").to_i;
var matrix = make_matrix(x, y); # create the matrix
matrix[y/2][x/2] = 1; # write something inside it
say matrix; # display the matrix