I try to figure out the easiest way in Scala to create an array of arrays, which are pairs (Actually any pairs is a Vector because later I will modify the pairs set to contain more than 2 elements). My first question: Is there a way to do it functionality and not with indices?
My second question (even with indices…), I tried to do something like
var vect: Vector[Vector[Int]] (initizlized to be empty)
for j=0…length && j!=i
What is the right way to do it in scala?
My problem was that I couldn’t do something like vect +: Vector(i,j) because this result should be assigned to a second vector (of pairs…). However, it seems weird for me to do something like:
var vect2 = vect ++ Vector(i,j) (I’m not sure it works in any case), becuase in this case vect really has no meaning, but what is the alternative to assign values to this object (or in english, is it possible to enter the elements to vect without define a dummy object?).
Thanks in advance!