diff --git a/tests/1/t1.zwei b/tests/1/t1.zwei new file mode 100755 index 0000000..a3278a9 --- /dev/null +++ b/tests/1/t1.zwei @@ -0,0 +1,15 @@ +class Factorial { +// Solution it�rative +def factorial1 (x : Int ): Int = { +var p : Int = 1; +while (x > 0 ) { +set p = p * x; +set x = x - 1; +} +p +}; +// Solution r�cursive +def factorial2 (x : Int ): Int = +if (x == 0 ) 1 +else x * this.factorial2 (x - 1 ); +} \ No newline at end of file