quakeforge/ruamoko/qwaq/gcd.r
Bill Currie 9bfd14b687 [qwaq] Bring in qc gcd to use for debugger testing
It was even recent enough to compile first try.
2020-03-24 23:02:19 +09:00

21 lines
266 B
R

void printf (string fmt, ...) = #0;
void traceon (void) = #0;
int x, y;
int
gcd (int a, int b)
{
if (b == 0) return a;
else return gcd (b, a % b);
}
int
main (int argc, string *argv)
{
traceon ();
x = 130;
y = 120;
printf ("%d\n", gcd (x, y));
return 0;
}