DataMuseum.dk

Presents historical artifacts from the history of:

RegneCentralen RC759 "Piccoline"

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RegneCentralen RC759 "Piccoline"

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦8715b6132⟧ TextFile

    Length: 1633 (0x661)
    Types: TextFile
    Names: »KRYSTAL.PAS«

Derivation

└─⟦37cf4f704⟧ Bits:30003051 Dymos II - Modeller
    └─⟦this⟧ »MODEL3\KRYSTAL.PAS« 

TextFile

program krystal;
const
n0 = 100;
max=2000;

type
index = -n0..n0;
arraytype = arrayÆindex,indexÅ of boolean;

var
a:arraytype;
i,j:integer;
x,y:real;
deffil:text;
tabelfil:file of real;


function stoed(x:real):real;
begin
  stoed:= (2*n0 - abs(x))*x/abs(x)
end; 

function lim(x,y:real):boolean;
var 
  i,j:index;
  xreal,yreal:real;
begin
if (abs(x)<=n0-1) and ( abs(y)<=n0-1) then
begin
  i:=round(x);j:=round(y);
    if aÆi-1,jÅ or 
       aÆi+1,jÅ or 
       aÆi-1,j+1Å or 
       aÆi,j+1Å or 
       aÆi+1,j+1Å or 
       aÆi-1,j-1Å or 
       aÆi,j-1Å or 
       aÆi+1,j-1Å then
    begin
      xreal:=i; yreal:=j;
      write(tabelfil, xreal, yreal );
      Writeln('  placeres i punktet (',i,',',j,'). ');
      lim:= true;
      aÆi,jÅ:=true;
    end
    else
      lim:=false;
end
else 
lim:=false; 
end;

  
begin
assign(tabelfil, 'ØdmiiØkrystal1.tab'); 
rewrite(tabelfil);
assign(deffil,'ØdmiiØkrystal1.def');
rewrite(deffil);

æv▶91◀rdiå
for i:=-n0 to n0 do for j:=-n0 to n0 do aÆi,jÅ:=false;
aÆ0,0Å:=true;


æmodelå
for i := 1 to max do
begin
  if (i mod 4) < 2 then
  begin
    x:=2*n0*random-n0;
    if (i mod 2) = 0 then 
      y:=n0
    else
      y:=-n0;
  end
  else
  begin
    y:=2*n0*random-n0;
    if (i mod 2) = 0 then
      x:=n0
    else
      x:=-n0;
  end;
  write('atom nr.  ',i);

  repeat
    x:= x+ random - 0.5 - x/1000;
    y:= y+ random - 0.5 - y/1000;
  until lim(x,y);

end;  
  
close(tabelfil);  
  
writeln(deffil,'Points   ',max);
writeln(deffil,'Variables X, Y');  
close(deffil);

end.