RosettaCodeData/Task/Create-a-two-dimensional-array-at-runtime/Objeck/create-a-two-dimensional-array-at-runtime.objeck

13 lines
337 B
Text
Raw Permalink Normal View History

2024-03-06 22:25:12 -08:00
class TwoDimArray {
function : Main(args : String[]) ~ Nil {
rows := Standard->ReadLine()->ToInt();
cols := Standard->ReadLine()->ToInt();
2023-07-01 11:58:00 -04:00
2024-03-06 22:25:12 -08:00
if(rows > 0 & cols > 0) {
array := Float->New[rows, cols];
array[0,0] := 42.0;
Standard->Print("The number at place [0,] is: ")->PrintLine(array[0,0]);
2023-07-01 11:58:00 -04:00
}
}
}