Floyd's triangle: Difference between revisions

no edit summary
imported>Maxima enthusiast
No edit summary
Line 4,564:
11 12 13 14 15
</pre>
 
=={{header|Maxima}}==
<syntaxhighlight lang="maxima">
floyd_t(m):=block(
t:m*(m+1)/2,
L1:makelist(makelist(k,k,1,t),j,0,m),
L2:makelist(rest(L1[i],((i-1)^2+(i-1))/2),i,1,m+1),
makelist(firstn(L2[i],i),i,1,m),
table_form(%%))$
 
/* Test cases */
floyd_t(5);
floyd_t(14);
</syntaxhighlight>
[[File:FloydTriangleMaxima5.png|thumb|center]]
[[File:FloydTriangleMaxima14.png|thumb|center]]
 
=={{header|Modula-2}}==