Figure 1
A DAPPLE program to compute Pascal's triangle.
const int N = 6; // we compute N rows of the triangle
intVector arow(N); // N elements, uninitialized
extern int Identity(int i); // defined by DAPPLE; returns i
const intVector VP(N, Identity);
// first row // Sequential equivalent
ifp (VP == 0) { //
arow = 1; // arow[0] = 1;
cout << arow << endl; // cout << arow[0] << endl;
} else // for (int i = 1; i < N; i++)
arow = 0; // arow[i] = 0;
// N-1 remaining rows
for (int i = 1; i < N; i++) { // for (int i = 1; i < N; i++) {
// for (int j = i; j > 0; j--)
arow += shift(arow, 1); // arow[j] += arow[j-1];
ifp (VP <= i) // for (int j = 0; j < i; j++)
cout << arow << endl; // cout << arow[j] << '\(\backslash\)t';
// cout << arow[i] << endl;
} // }