Click or drag to resize

Arrays

GoManga MathStudio Language does not distinguish simple variables and arrays or lists. Arrays are treated just like other variables

Declaration

To use an array, just use the [array{i}] notation.

//Make a vector of the first 10 squares
for [i] = 0 to 10 do [i]++ then
[Vect{i}] = calc {i}^2
endfor

//Print the vector values
for [i] = 0 to 10 do [i]++ then
output {Vect{i}}
endfor

//Make a martix of the first 100 squares
for [i] = 0 to 10 do [i]++ then
  for [j] = 0 to 10 do [j]++ then
    [mat{i}{j}] = calc ({j}*10+{i})^2
  endfor
endfor

//Print the matrix value
for [i] = 0 to 10 do [i]++ then
  for [j] = 0 to 10 do [j]++ then
    outputl {mat{i}{j}}
    outputl.
  endfor
  output.
endfor