RosettaCodeData/Task/Create-a-two-dimensional-array-at-runtime/Ruby/create-a-two-dimensional-array-at-runtime.rb

6 lines
111 B
Ruby
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
puts 'Enter width and height: '
w=gets.to_i
arr = Array.new(gets.to_i){Array.new(w)}
arr[1][3] = 5
p arr[1][3]