Skip to main content
added 217 characters in body
Source Link
unclemeat
  • 2.3k
  • 1
  • 17
  • 23

Batch

@set /a t=1 &^
for /L %%a in (2, 1, %1) ^
do @set /a t*=%%a

Pronunciation; ignores mathematical expressions as well as these symbols @ / % ^ , ( ):

set a t 1 and
for L a in 2 1 1
do set a t a

Note; this calculates the factorial, it doesn't output it - the variable t contains the factorial.

The following Haiku / code can be appended to the same batch file to output the factorial (the |'s are pronounced as pipe):

@echo %t% ||^
When will you learn, unclemeat ^
Why must you use Batch?

Batch

@set /a t=1 &^
for /L %%a in (2, 1, %1) ^
do @set /a t*=%%a

Pronunciation; ignores mathematical expressions as well as these symbols @ / % ^ , ( ):

set a t 1 and
for L a in 2 1 1
do set a t a

Note; this calculates the factorial, it doesn't output it - the variable t contains the factorial.

Batch

@set /a t=1 &^
for /L %%a in (2, 1, %1) ^
do @set /a t*=%%a

Pronunciation; ignores mathematical expressions as well as these symbols @ / % ^ , ( ):

set a t 1 and
for L a in 2 1 1
do set a t a

Note; this calculates the factorial, it doesn't output it - the variable t contains the factorial.

The following Haiku / code can be appended to the same batch file to output the factorial (the |'s are pronounced as pipe):

@echo %t% ||^
When will you learn, unclemeat ^
Why must you use Batch?
Source Link
unclemeat
  • 2.3k
  • 1
  • 17
  • 23

Batch

@set /a t=1 &^
for /L %%a in (2, 1, %1) ^
do @set /a t*=%%a

Pronunciation; ignores mathematical expressions as well as these symbols @ / % ^ , ( ):

set a t 1 and
for L a in 2 1 1
do set a t a

Note; this calculates the factorial, it doesn't output it - the variable t contains the factorial.