I am just trying to make a function that fills an array with objects, but something is wrong:
row1 = []
class Tile
def initialize(type)
@type = type
end
end
def FillRow1
[1..10].each {
random = rand(1..3)
if random == 1 row1.(Tile.new("land") end
else if random == 2 row1.(Tile.new("Water") end
else ifrandom == 3 row1.(Tile.new("empty") end
}
row1
end