[ create a new paste ] login | about

Link: http://codepad.org/Fz0MLRqT    [ raw code | fork ]

Plain Text, pasted on Feb 27:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
for(I, J, _F, Acc) when I > J ->
  Acc;
for(I, J, F, Acc) ->
  for(I + 1, J, F, F(I,Acc)).

random_matrix(Size, MaxVal) ->
  {A1,A2,A3} = now(),
  random:seed(A1,A2,A3),
  for(1, Size, fun(X, Rows) ->
    Row = for(1, Size, fun(Y, Cols) ->
      io:fwrite("~w~n", [Cols]),
      case Y of
        X -> [0|Cols];
        _ -> [random:uniform(MaxVal)|Cols]
      end     
    end, []),
    [Row|Rows]
  end, []).


Create a new paste based on this one


Comments: