Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def createMatrix dimension
- arr = Array.new(dimension) { Array.new(dimension) }
- random = Random.new
- arr.each do |row|
- row.each do |column|
- column = random.rand(0...1)
- end
- end
- arr
- end
Advertisement
Add Comment
Please, Sign In to add comment