From 8582e3520ff487ea71e68a10fa8641fd95e74706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20B=C3=B6hm?= Date: Tue, 7 Jul 2009 10:43:01 +0200 Subject: cleanup test code --- test/ggt.t | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test/ggt.t (limited to 'test/ggt.t') diff --git a/test/ggt.t b/test/ggt.t new file mode 100644 index 0000000..2eeb07a --- /dev/null +++ b/test/ggt.t @@ -0,0 +1,30 @@ +fun main[] + x = call ggt1[30,40] + print x + y = call ggt2[30,40] + print y + if x == y + @0 + end + @1 +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