It’s there a reason you’re using a Vector{Vector{String}} (or technically Vector{Vector{Any}})? This seems like a good use case for a Matrix{Int} from the example.
Answering your actual question, to concatenate vectors into a matrix, you can use matrix literals:
julia> u = [1, 2, 3]; v = collect("abc");
julia> [u v]
3×2 Array{Any,2}:
1 'a'
2 'b'
3 'c'
This works because matrix literals have spaces to separate elements horizontally, and semicolons to separate rows:
julia> [1 2; 3 4]
2×2 Array{Int64,2}:
1 2
3 4
If you want your code to use this, you’ll notice that, since allarr = [] has zero columns, the first iteration runs into a dimension-mismatch problem.
You can solve this by initially making allarr an empty 3×0 matrix (yes, that’s different to []!) like so: fill('A', 3, 0) or Matrix{Char}(undef, 3, 0).
function minesweeper(input)
allarr = Matrix{Char}(undef, 3, 0) # initialise 3×0 matrix of `Char`s with arbitrary `undef`ed entries
for line in input
arr = collect(line)
allarr = [allarr arr]
end
permutedims(allarr)
end
Notice I used collect(line) instead of split(line, "") to give a Vector{Char} and transposed the final matrix with permutedims to match the input.
This produces a proper Matrix (aka 2-dimensional Array), and not a vector of vectors.