#!/usr/local/bin/gentee -r

func uint factorial( uint n )
{
   if n < 3 : return n
   return n * factorial( n - 1 )
}

func main<main>
{
   uint    n
   
   print("This program calculates n! ( 1 * 2 *...* n ) for n from 1 to 12\n\n")

   fornum n = 1, 13
   {
      print("\(n)! = \( factorial( n ))\n")
   }
   getch()
}
