Catalan numbers/Pascal's triangle: Difference between revisions

Content added Content deleted
(Added Lua version)
m (→‎{{header|Lua}}: fixed explanation)
Line 719: Line 719:


=={{header|Lua}}==
=={{header|Lua}}==
For each line of odd-numbered length from Pascal's triangle, subtract the middle number from the one immediately to its right. This solution is heavily based on the Lua code to generate Pascal's triangle on the page for that task.
For each line of odd-numbered length from Pascal's triangle, print the middle number minus the one immediately to its right.
This solution is heavily based on the Lua code to generate Pascal's triangle from the page for that task.
<lang Lua>function nextrow (t)
<lang Lua>function nextrow (t)
local ret = {}
local ret = {}