Why is my output not getting reflected in Lst1?
-module(pmap).
-export([start/0,test/2]).
test(Lst1,0) ->
{ok, [Temp]} = io:fread( "Input the edge weight ", "~d" ),
lists:append([Lst1,[Temp]]),
io:fwrite("~w~n",[Lst1]);
test(Lst1,V) ->
{ok, [Temp]} = io:fread( "Input the edge weight ", "~d" ),
lists:append([Lst1,[Temp]]),
test(Lst1, V-1).
start() ->
{ok, [V]} = io:fread( "Input the number of vertices your graph has ", "~d" ),
Lst1 = [],
test(Lst1,V).
So, my Lst1 is printing [], whereas I expect it to print, suppose, [1,2,3] if I provide input 1,2,3.