2 of 8 no cheating

PHP, 56 bytes

<? $r=$i=$argv[1];while($i>1){$i--;$r=$r*$i;} echo $r;?>

And heres my proof using Pi, Raspberry Pi. :D

root@raspberrypi:~# php fact.php 5
120root@raspberrypi:~#

But because it's a code golf here's a list of bugs:

  • there is no \n
  • throws error if no parameter
  • 0! seems to be 0