program ndamen;
{$N+}
program shortlady;
uses crt,dos;
const teiler=90;
var z:array[1..100] of integer;
sp:array[1..100] of boolean;
steidiag:array[1-100..100+1] of boolean;
falldiag:array[2..2*100] of boolean;
k:integer;
anz:longint;
cdame:byte;
orgint08:procedure;
time:extended;
const copyright:array[1..16] of string[8]=
((' **** '),
(' * * '),
('* ** *'),
('* * *'),
('* ** *'),
(' * * '),
(' **** '),
(' '),
(' '),
(' '),
(' '),
(' '),
(' '),
(' '),
(' '),
(' '));
var copy:array[1..16] of byte;
procedure initmysatz(startchar:word);
var p:pointer;
long:word;
begin
p:=@copy;
long:=sizeof(copy);
asm
push bp
push es
mov ax,$1110
mov bx,$1000
mov cx,long
mov dx,startchar
les bp,p
int $10
pop es
pop bp
end;
end;
procedure setoldsatz;assembler;
asm
mov ax,$1114
mov bl,0
int $10
end;
procedure convert;
var i,j,m:byte;
begin
for i:=1 to 16 do
begin
m:=0;
for j:=1 to 8 do
if copyright[i][j]<>' ' then
m:=m+128 shr (j-1);
copy[i]:=m;
end;
end;
procedure lsgaus;
var j1:byte;
begin;
inc(anz);
end;
procedure setze(i:integer);
var j:integer;
begin
for j:=1 to cdame do
begin
if sp[j] and falldiag[i+j] and steidiag[i-j] then
begin;
z[i]:=j;
sp[j]:=false;
falldiag[i+j]:=false;
steidiag[i-j]:=false;
if i<cdame then setze(i+1) else lsgaus;
sp[j]:=true;
falldiag[i+j]:=true;steidiag[i-j]:=true;
end;
end;
end;
procedure myint08;interrupt;
begin
time:=time+1/18.2;
asm pushf end;
orgint08;
end;
var min:longint;
BEGIN
convert;
initmysatz(255);
clrscr;
writeln('ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»');
writeln('Ί Damenproblem mit Zeitmessung by MOSOFT',chr(255),' Ί');
writeln('ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ');
writeln;
time:=0;
min:=0;
anz:=0;
cdame:=100;
for k:=1 to cdame do sp[k]:=true;
for k:=2 to cdame*2 do falldiag[k]:=true;
for k:=1-cdame to cdame+1 do steidiag[k]:=true;
cdame:=0;
getintvec($08,@orgint08);
while not keypressed do
begin
anz:=0;
time:=0;
inc(cdame);
setintvec($08,@myint08);
setze(1);
setintvec($08,@orgint08);
min:=trunc(min/60);
time:=time-min*60;
writeln('L"sungen fr ',cdame:2,' Damen ',anz:12,' Zeit: ',min:5,' min, ',time:2:2,' sec');
end;
writeln;
writeln('Von Jens Heymann und Holger Metzler');
readln;readln;
setoldsatz;
END.