I have a list of arcs(200lines max) in a graph like shown below. The triple is (x, y, z) which means an edge from x to y at weight z. I know exactly how many lines are in the file(number of edges), the number of nodes too. I want to create an adjacency matrix input with these edges in Scala using List from Scala. Syntax is like i.e for example`List(List(0,0,0,0), List(0,0,0,0)))` I want to have a script that can take in a .txt file of the form shown below and output Scala syntax of an adj. list from these edges. 

`LIST OF ARCS
0 1 0.440004
0 2 0.244452
0 3 0.433273`

For the input above, the output should be 

`ListBuffer(
 ListBuffer(0, 0.440004, 0.244452, 0.433273),
 ListBuffer(0.440004, 0, 0, 0),
 ListBuffer(0.244452, 0, 0, 0),
 ListBuffer(0.433273, 0, 0, 0))`
Here is what I have and my idea. 
val lines = Source.fromFile("f1.txt").getLines.toList.map(i => println(i))
I can prefill a ListBuffer.fill(10)(10) and then if I can figure out how to make each line a triple of type Ints, then I can update the ListBuffer structure I prefilled.