summaryrefslogtreecommitdiffstats
path: root/test/test5.t
blob: c6e786d8d11d267d842a066e21485163bf9cbdb3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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