RosettaCodeData/Task/Create-a-two-dimensional-array-at-runtime/Euphoria/create-a-two-dimensional-array-at-runtime.euphoria
Ingy döt Net 764da6cbbb CDE
2013-04-10 16:57:12 -07:00

15 lines
327 B
Text

include get.e
sequence array
integer height,width,i,j
height = floor(prompt_number("Enter height: ",{}))
width = floor(prompt_number("Enter width: ",{}))
array = repeat(repeat(0,width),height)
i = floor(height/2+0.5)
j = floor(width/2+0.5)
array[i][j] = height + width
printf(1,"array[%d][%d] is %d\n", {i,j,array[i][j]})