how to use code to create a Pyramid

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
jeb
Expert
Posts: 1041
Joined: 30 Aug 2007 08:05
Location: Germany, Bochum

Re: how to use code to create a Pyramid

#31 Post by jeb » 17 Mar 2017 08:22

The modified version needs only 63 bytes

Code: Select all

@set\=                 A
:\
@set\=%\:~1%AA&2>nul echo%\%&&goto\

But the last of your modifications is quite different than the starting pyramid, it outputs one line less than the original.
This can be corrected by adding one space to the first set

My own experiments are currently only at 75 bytes, but i don't need any IF nor the conditional && modifier

Code: Select all

@set\=                 A
:\
@echo\%\%&(set\=%\:~1%AA<nul ^%\:~34% ^
&goto\)


jeb

Post Reply