11-22-2019, 08:45 AM
Hello
I need some help. I do not program often and when I do I have doubts.
I try to put the values of the Pascal triangle,
1 --- m1(1,1)
1 1 --- m1(2,1) m1(2,2)
1 2 1 --- m1(3,1), etc
1 3 3 1
……………..
to a matrix that I call "m1" up to "f" lines, in the following way:
EXPORT Tri_Pa(f)
BEGIN
LOCAL n,m;
LOCAL m1;
FOR n FROM 0 TO f DO
FOR m FROM 0 TO n DO
m1(n,m):=COMB(n,m);
END;
END;
END;
But the program stops in the line "m1(n,m):=…", and says: "Invalid input".
How should I define the matrix to avoid the error?
Thanks in advance for your help
Toni
I need some help. I do not program often and when I do I have doubts.
I try to put the values of the Pascal triangle,
1 --- m1(1,1)
1 1 --- m1(2,1) m1(2,2)
1 2 1 --- m1(3,1), etc
1 3 3 1
……………..
to a matrix that I call "m1" up to "f" lines, in the following way:
EXPORT Tri_Pa(f)
BEGIN
LOCAL n,m;
LOCAL m1;
FOR n FROM 0 TO f DO
FOR m FROM 0 TO n DO
m1(n,m):=COMB(n,m);
END;
END;
END;
But the program stops in the line "m1(n,m):=…", and says: "Invalid input".
How should I define the matrix to avoid the error?
Thanks in advance for your help
Toni