RosettaCodeData/Task/Create-a-two-dimensional-array-at-runtime/Objeck/create-a-two-dimensional-array-at-runtime.objeck
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

23 lines
524 B
Text

use IO;
bundle Default {
class TwoDee {
function : Main(args : System.String[]) ~ Nil {
DoIt();
}
function : native : DoIt() ~ Nil {
Console->GetInstance()->Print("Enter x: ");
x := Console->GetInstance()->ReadString()->ToInt();
Console->GetInstance()->Print("Enter y: ");
y := Console->GetInstance()->ReadString()->ToInt();
if(x > 0 & y > 0) {
array : Int[,] := Int->New[x, y];
array[0, 0] := 2;
array[0, 0]->PrintLine();
};
}
}
}