From 3ace855e1a5707de68c530c17f24cde226b19bb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20N=C3=BC=C3=9Flein?= Date: Mon, 6 Jul 2009 21:42:42 +0200 Subject: ggT example --- test/test5.t | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/test5.t diff --git a/test/test5.t b/test/test5.t new file mode 100644 index 0000000..c6e786d --- /dev/null +++ b/test/test5.t @@ -0,0 +1,27 @@ +fun main[] + x = call ggt1[30,40] + print x + y = call ggt2[30,40] + print y + @x == y +end + +fun ggt1[x,y] + while x != y + if x > y + x = x - y + else + y = y - x + end + end + @x +end + +fun ggt2[a,b] + while b + x = a + a = b + b = x % b + end + @a +end -- cgit v1.2.3