Create a two-dimensional array at runtime: Difference between revisions
Content added Content deleted
(Added Easylang) |
|||
Line 2,409: | Line 2,409: | ||
=={{header|Objeck}}== |
=={{header|Objeck}}== |
||
<syntaxhighlight lang="objeck"> |
<syntaxhighlight lang="objeck"> |
||
class TwoDimArray { |
|||
use IO; |
|||
⚫ | |||
rows := Standard->ReadLine()->ToInt(); |
|||
cols := Standard->ReadLine()->ToInt(); |
|||
⚫ | |||
bundle Default { |
|||
⚫ | |||
class TwoDee { |
|||
⚫ | |||
⚫ | |||
Standard->Print("The number at place: ")->PrintLine(array[0,0]); |
|||
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[0, 0]->PrintLine(); |
|||
}; |
|||
} |
|||
} |
} |
||
} |
} |