I would want to fill a Seq[Seq[Int]]
instance with an existing Seq[Int]
by using the method fill(n1, n2)(element : A)
of the Object Seq
, as detailed in the documentation : http://www.scala-lang.org/api/2.12.3/scala/collection/Seq$.html#fillA(elem:=>A):CC[CC[A]]
So I wrote this call :
Seq.fill(width, width)(_random_values.)
, with _random_values
the existing Seq[Int]
.
The problem is that the parameter of the second list of fill
is an element, not a Seq
. So, what could I type to iterate on each _random_values
's integers AND to execute the Seq.fill
for each current integer ?
Seq(1,2,3)
what would be the desired outcome? – Sebastianwidth
= 2 and aSeq(1, 2, 3, 4)
, my outcome would beSeq(Seq(1, 2) , Seq(3, 4))
. (NB :width
= "dimension") – JarsOfJam-Scheduler