Ask Ben: Recursive Numeric Pyramid

<!--- Get the max height of the numeric pyramid. --->
<cfset intHeight = 4 />
 
<!---
	Loop over the number of rows that we want to display
	in our numeric pyramid. This will start at negative
	*height* and go to positive *height*. This will give
	us ((height * 2) + 1) rows.
--->
<cfloop
	index="intRow"
	from="#-intHeight#"
	to="#intHeight#"
	step="1">
 
	<!---
		Loop over the number of columns in this row,
		starting at zero.
	--->
	<cfloop
		index="intCol"
		from="0"
		to="#(intHeight - Abs( intRow ))#"
		step="1">
 
		#intCol#
 
	</cfloop>
 
	<!--- Line break. --->
	<br />
 
</cfloop>

For Cut-and-Paste