NullLogic

calculates the factorial of a number

#!/usr/bin/nsp /* inspired by unreadable text at http://progopedia.ru/language/nesla/ #!/usr/bin/nesla function factorial(n) { if (n == 0) { return 1; } else { return n * factorial(n - 1); } } for (n = 0; n <= 16; n++) { print(n, "! = ", factorial(n), "\n"); } */ function factorial(n) { return n>1?(n*factorial(n-1)):1; } for (i=0;i<22;i++) printf("%d! = %d\r\n", i, factorial(i));