Multiplication tables: Difference between revisions
Content added Content deleted
No edit summary |
imported>Maxima enthusiast |
||
Line 5,376: | Line 5,376: | ||
);</syntaxhighlight> |
);</syntaxhighlight> |
||
Constructing a function to handle cases like this one |
|||
[[File:Multiplication table.png|thumb|Formatted output using table_form]] |
|||
<syntaxhighlight lang="maxima"> |
|||
/* Auxiliar function */ |
|||
aux_table(n,k):=append([k],makelist(0,i,1,k-1),makelist(k*i,i,k,n))$ |
|||
/* Function to construct the formatted table */ |
|||
table_mult(n):=block( |
|||
append([makelist(i,i,0,n)],makelist(aux_table(n,k),k,1,n)), |
|||
makelist(at(%%[i],0=""),i,2,length(%%)), |
|||
table_form(%%))$ |
|||
/* Test case */ |
|||
table_mult(12); |
|||
</syntaxhighlight> |
|||
=={{header|МК-61/52}}== |
=={{header|МК-61/52}}== |