:: pyramid.bat @echo off setlocal enabledelayedexpansion for /l %%i in (1,1,%1) do ( set t=!t!* echo !t! ) for /l %%i in (%1,-1,2) do ( set t=!t:~1,%%i! echo !t! ) endlocal goto :EOF