Added a NOFLOAT define. (Taken from Koen Langendoen)
This commit is contained in:
parent
36ef5b504b
commit
256847556e
|
@ -1,3 +1,4 @@
|
|||
#
|
||||
{
|
||||
(c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
|
||||
|
@ -24,14 +25,30 @@ type wavelength = (red,blue,yellow,q1,q2,q3,q4,q5,q6,q7,q8,q9,q10,q11,
|
|||
pink,green,orange);
|
||||
spectrum= set of wavelength;
|
||||
bit = 0..1;
|
||||
|
||||
#ifndef NOFLOAT
|
||||
tp3= packed record c1:char; i:integer; p:boolean; x:real end;
|
||||
tp4= record c1:char; i:integer; p:boolean; x:real end;
|
||||
#else
|
||||
tp3= packed record c1:char; i:integer; p:boolean; end;
|
||||
tp4= record c1:char; i:integer; p:boolean; end;
|
||||
#endif
|
||||
|
||||
vec1 = array [-10..+10] of integer;
|
||||
|
||||
#ifndef NOFLOAT
|
||||
vrec = record case t:boolean of false:(r:real); true:(b:bit) end;
|
||||
#else
|
||||
vrec = record case t:boolean of false:(); true:(b:bit) end;
|
||||
#endif
|
||||
|
||||
var t,pct,ect:integer;
|
||||
i,j,k,l:integer;
|
||||
|
||||
#ifndef NOFLOAT
|
||||
x,y: real;
|
||||
#endif
|
||||
|
||||
p:boolean;
|
||||
c2:char;
|
||||
a1: vec1;
|
||||
|
@ -104,12 +121,23 @@ begin t:=36; pct:=pct+1;
|
|||
colors := f2^; get(f2); if colors <> [red] then e(5);
|
||||
colors := f2^; get(f2); if colors <> [blue,red] then e(6);
|
||||
colors := f2^; get(f2); if colors <> [blue,yellow] then e(7);
|
||||
|
||||
#ifndef NOFLOAT
|
||||
r3.c1:='w'; r3.i:= -100; r3.x:=303.56; r3.p:=true; f3^:=r3; put(f3);
|
||||
r3.c1:='y'; r3.i:= -35; r3.x:=26.32; f3^:=r3; put(f3);
|
||||
r3.c1:='q'; r3.i:= +29; r3.x:=10.00; f3^:=r3; put(f3);
|
||||
r3.c1:='j'; r3.i:= 8; r3.x:=10000; f3^:=r3; put(f3);
|
||||
#else
|
||||
r3.c1:='w'; r3.i:= -100; r3.p:=true; f3^:=r3; put(f3);
|
||||
r3.c1:='y'; r3.i:= -35; f3^:=r3; put(f3);
|
||||
r3.c1:='q'; r3.i:= +29; f3^:=r3; put(f3);
|
||||
r3.c1:='j'; r3.i:= 8; f3^:=r3; put(f3);
|
||||
#endif
|
||||
|
||||
for i:= 1 to 1000 do begin f3^ := r3; put(f3) end;
|
||||
reset(f3);
|
||||
|
||||
#ifndef NOFLOAT
|
||||
r3 := f3^; get(f3);
|
||||
if (r3.c1<>'w') or (r3.i<>-100) or (r3.x<>303.56) then e(8);
|
||||
r3 := f3^; get(f3);
|
||||
|
@ -118,13 +146,34 @@ begin t:=36; pct:=pct+1;
|
|||
if (r3.c1<>'q') or (r3.i<> 29) or (r3.x<> 10.00) then e(10);
|
||||
r3 := f3^; get(f3);
|
||||
if (r3.c1<>'j') or (r3.i<> 8) or (r3.x<> 10000) then e(11);
|
||||
#else
|
||||
r3 := f3^; get(f3);
|
||||
if (r3.c1<>'w') or (r3.i<>-100) then e(8);
|
||||
r3 := f3^; get(f3);
|
||||
if (r3.c1<>'y') or (r3.i<> -35) then e(9);
|
||||
r3 := f3^; get(f3);
|
||||
if (r3.c1<>'q') or (r3.i<> 29) then e(10);
|
||||
r3 := f3^; get(f3);
|
||||
if (r3.c1<>'j') or (r3.i<> 8) then e(11);
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef NOFLOAT
|
||||
r4.c1:='w'; r4.i:= -100; r4.x:=303.56; r4.p:=true; f4^:=r4; put(f4);
|
||||
r4.c1:='y'; r4.i:= -35; r4.x:=26.32; f4^:=r4; put(f4);
|
||||
r4.c1:='q'; r4.i:= +29; r4.x:=10.00; f4^:=r4; put(f4);
|
||||
r4.c1:='j'; r4.i:= 8; r4.x:=10000; f4^:=r4; put(f4);
|
||||
#else
|
||||
r4.c1:='w'; r4.i:= -100; r4.p:=true; f4^:=r4; put(f4);
|
||||
r4.c1:='y'; r4.i:= -35; f4^:=r4; put(f4);
|
||||
r4.c1:='q'; r4.i:= +29; f4^:=r4; put(f4);
|
||||
r4.c1:='j'; r4.i:= 8; f4^:=r4; put(f4);
|
||||
#endif
|
||||
|
||||
for i:= 1 to 1000 do begin f4^ := r4; put(f4) end;
|
||||
reset(f4);
|
||||
|
||||
#ifndef NOFLOAT
|
||||
r4 := f4^; get(f4);
|
||||
if (r4.c1<>'w') or (r4.i<>-100) or (r4.x<>303.56) then e(12);
|
||||
r4 := f4^; get(f4);
|
||||
|
@ -133,6 +182,17 @@ begin t:=36; pct:=pct+1;
|
|||
if (r4.c1<>'q') or (r4.i<> 29) or (r4.x<> 10.00) then e(13);
|
||||
r4 := f4^; get(f4);
|
||||
if (r4.c1<>'j') or (r4.i<> 8) or (r4.x<> 10000) then e(14);
|
||||
#else
|
||||
r4 := f4^; get(f4);
|
||||
if (r4.c1<>'w') or (r4.i<>-100) then e(12);
|
||||
r4 := f4^; get(f4);
|
||||
if (r4.c1<>'y') or (r4.i<> -35) then e(13);
|
||||
r4 := f4^; get(f4);
|
||||
if (r4.c1<>'q') or (r4.i<> 29) then e(13);
|
||||
r4 := f4^; get(f4);
|
||||
if (r4.c1<>'j') or (r4.i<> 8) then e(14);
|
||||
#endif
|
||||
|
||||
|
||||
for j:= 1 to 100 do
|
||||
begin for i:= -10 to +10 do a1[i] := i*j; f5^ := a1; put(f5); end;
|
||||
|
@ -140,12 +200,15 @@ begin t:=36; pct:=pct+1;
|
|||
for j:= 1 to 99 do
|
||||
begin a1:=f5^; get(f5); for i:= -10 to +10 do if a1[i]<> i*j then e(14) end;
|
||||
|
||||
#ifndef NOFLOAT
|
||||
vr.t:=false;
|
||||
for i:= 1 to 1000 do begin vr.r:=i+0.5; f6^:=vr; put(f6) ; p:=true; end;
|
||||
reset(f6); p:=false;
|
||||
for i:= 1 to 999 do
|
||||
begin vr:=f6^; get(f6); if vr.r <> i+0.5 then p:=true end;
|
||||
if p then e(15);
|
||||
#endif
|
||||
|
||||
rewrite(f6);
|
||||
if not eof(f6) then e(16);
|
||||
for i:= 1 to 1000 do begin vr.b:=i mod 2; f6^:=vr; put(f6) end;
|
||||
|
@ -163,12 +226,15 @@ begin t:=36; pct:=pct+1;
|
|||
reset(f1);
|
||||
if ord(f1^) <> 32 then e(20);
|
||||
|
||||
#ifndef NOFLOAT
|
||||
rewrite(f1);
|
||||
x:=0.0625; write(f1,x:6:4, x:6:2);
|
||||
reset(f1); read(f1,y); if y <> 0.0625 then e(21);
|
||||
reset(f1); for i:= 1 to 12 do begin c[i]:= f1^; get(f1) end;
|
||||
if (c[1]<>'0') or (c[2]<>'.') or (c[4]<>'6') then e(22);
|
||||
if (c[7]<>' ') or (c[9]<>'0') or (c[10]<>'.') or (c[12]<>'6') then e(23);
|
||||
#endif
|
||||
|
||||
end;
|
||||
|
||||
{************************************************************************}
|
||||
|
@ -202,13 +268,24 @@ var g1: text;
|
|||
colors := g2^; get(g2); if colors <> [pink] then e(8);
|
||||
colors := g2^; get(g2); if colors <> [green,pink] then e(9);
|
||||
colors := g2^; get(g2); if colors <> [green,orange] then e(10);
|
||||
|
||||
#ifndef NOFLOAT
|
||||
r4.c1:='w'; r4.i:= -100; r4.x:=303.56; g3^:=r4; put(g3);
|
||||
r4.c1:='y'; r4.i:= -35; r4.x:=26.32; g3^:=r4; put(g3);
|
||||
r4.c1:='q'; r4.i:= +29; r4.x:=10.00; g3^:=r4; put(g3);
|
||||
r4.c1:='j'; r4.i:= 8; r4.x:=10000; g3^:=r4; put(g3);
|
||||
#else
|
||||
r4.c1:='w'; r4.i:= -100; g3^:=r4; put(g3);
|
||||
r4.c1:='y'; r4.i:= -35; g3^:=r4; put(g3);
|
||||
r4.c1:='q'; r4.i:= +29; g3^:=r4; put(g3);
|
||||
r4.c1:='j'; r4.i:= 8; g3^:=r4; put(g3);
|
||||
#endif
|
||||
|
||||
for i:= 1 to 1000 do begin g3^ := r4; put(g3) end;
|
||||
reset(g3);
|
||||
if eof(g3) then e(11);
|
||||
|
||||
#ifndef NOFLOAT
|
||||
r4 := g3^; get(g3);
|
||||
if (r4.c1<>'w') or (r4.i<>-100) or (r4.x<>303.56) then e(12);
|
||||
r4 := g3^; get(g3);
|
||||
|
@ -217,6 +294,17 @@ var g1: text;
|
|||
if (r4.c1<>'q') or (r4.i<> 29) or (r4.x<> 10.00) then e(14);
|
||||
r4 := g3^; get(g3);
|
||||
if (r4.c1<>'j') or (r4.i<> 8) or (r4.x<> 10000) then e(15);
|
||||
#else
|
||||
r4 := g3^; get(g3);
|
||||
if (r4.c1<>'w') or (r4.i<>-100) then e(12);
|
||||
r4 := g3^; get(g3);
|
||||
if (r4.c1<>'y') or (r4.i<> -35) then e(13);
|
||||
r4 := g3^; get(g3);
|
||||
if (r4.c1<>'q') or (r4.i<> 29) then e(14);
|
||||
r4 := g3^; get(g3);
|
||||
if (r4.c1<>'j') or (r4.i<> 8) then e(15);
|
||||
#endif
|
||||
|
||||
|
||||
for j:= 1 to 100 do
|
||||
begin for i:= -10 to +10 do a1[i] := i*j; g4^ := a1; put(g4) end;
|
||||
|
@ -261,13 +349,24 @@ var g1: text;
|
|||
colors := g2^; get(g2); if colors <> [pink] then e(8);
|
||||
colors := g2^; get(g2); if colors <> [green,pink] then e(9);
|
||||
colors := g2^; get(g2); if colors <> [green,orange] then e(10);
|
||||
|
||||
#ifndef NOFLOAT
|
||||
r4.c1:='w'; r4.i:= -100; r4.x:=303.56; g3^:=r4; put(g3);
|
||||
r4.c1:='y'; r4.i:= -35; r4.x:=26.32; g3^:=r4; put(g3);
|
||||
r4.c1:='q'; r4.i:= +29; r4.x:=10.00; g3^:=r4; put(g3);
|
||||
r4.c1:='j'; r4.i:= 8; r4.x:=10000; g3^:=r4; put(g3);
|
||||
#else
|
||||
r4.c1:='w'; r4.i:= -100; g3^:=r4; put(g3);
|
||||
r4.c1:='y'; r4.i:= -35; g3^:=r4; put(g3);
|
||||
r4.c1:='q'; r4.i:= +29; g3^:=r4; put(g3);
|
||||
r4.c1:='j'; r4.i:= 8; g3^:=r4; put(g3);
|
||||
#endif
|
||||
|
||||
for i:= 1 to 1000 do begin g3^ := r4; put(g3) end;
|
||||
reset(g3);
|
||||
if eof(g3) then e(11);
|
||||
|
||||
#ifndef NOFLOAT
|
||||
r4 := g3^; get(g3);
|
||||
if (r4.c1<>'w') or (r4.i<>-100) or (r4.x<>303.56) then e(12);
|
||||
r4 := g3^; get(g3);
|
||||
|
@ -276,6 +375,16 @@ var g1: text;
|
|||
if (r4.c1<>'q') or (r4.i<> 29) or (r4.x<> 10.00) then e(14);
|
||||
r4 := g3^; get(g3);
|
||||
if (r4.c1<>'j') or (r4.i<> 8) or (r4.x<> 10000) then e(15);
|
||||
#else
|
||||
r4 := g3^; get(g3);
|
||||
if (r4.c1<>'w') or (r4.i<>-100) then e(12);
|
||||
r4 := g3^; get(g3);
|
||||
if (r4.c1<>'y') or (r4.i<> -35) then e(13);
|
||||
r4 := g3^; get(g3);
|
||||
if (r4.c1<>'q') or (r4.i<> 29) then e(14);
|
||||
r4 := g3^; get(g3);
|
||||
if (r4.c1<>'j') or (r4.i<> 8) then e(15);
|
||||
#endif
|
||||
|
||||
for j:= 1 to 100 do
|
||||
begin for i:= -10 to +10 do a1[i] := i*j; g4^ := a1; put(g4) end;
|
||||
|
|
Loading…
Reference in a new issue