mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
Add my QuakePascal test program.
Trivial as it is...
This commit is contained in:
parent
ea3895805b
commit
b76a5c5284
1 changed files with 15 additions and 0 deletions
15
tools/qfcc/test/gcd.pas
Normal file
15
tools/qfcc/test/gcd.pas
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
program example (input, output);
|
||||||
|
var x, y: integer;
|
||||||
|
procedure printf (format:string; ...) := #0;
|
||||||
|
function gcd (a, b: integer): integer;
|
||||||
|
var c: quaternion;
|
||||||
|
begin
|
||||||
|
if b = 0 then gcd := a
|
||||||
|
else gcd := gcd (b, a mod b)
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
x := 130;
|
||||||
|
y := 120;
|
||||||
|
printf ("%d\n", gcd (x, y))
|
||||||
|
end.
|
Loading…
Reference in a new issue