DataMuseum.dk

Presents historical artifacts from the history of:

RegneCentralen RC700 "Piccolo"

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

See our Wiki for more about RegneCentralen RC700 "Piccolo"

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦ca925b82a⟧ TextFile

    Length: 1920 (0x780)
    Types: TextFile
    Names: »HYP«

Derivation

└─⟦2a24d2e1b⟧ Bits:30003042 Programmer fra Aarhus kursus
    └─ ⟦this⟧ »HYP« 

TextFile

const maxord=300;
type ministreng = string(.30.);
var
  liste: array (.1..maxord.) of record
                               ord:ministreng;
                               ant:integer;
                             end;
  sidste: integer;

  procedure initialiser;
  begin
    sidste:=0;
  end;

  procedure tilfoej(ord: streng);
  var
    p,i: integer; fundet, stop: boolean;
    ord1: ministreng;
 begin
    ord1:=copy(ord,1,30);
    p:=1; fundet:=false; stop:=false;
    while (p<=sidste) and (not stop) do
    begin
      if liste(.p.).ord<ord1 then
        p:=p+1
      else
      begin
        stop:=true;
        if liste(.p.).ord=ord1 then
          fundet:=true;
      end;
    end;

    if fundet then
      liste(.p.).ant:=liste(.p.).ant+1
    else
    begin
      if sidste=maxord then
        writeln('Ikke plads til flere')
      else
      begin
        i:=sidste;
        while i >= p do
        begin
          liste(.i+1.) := liste(.i.);
          i:=i-1;
        end;
        sidste:=sidste+1;
        liste(.p.).ord:=ord1; liste(.p.).ant:=1;
      end;
    end;
  end; (* tilfoej *)

  procedure fjern(i: integer);
  var
    j: integer;
  begin
    for j:=i to sidste-1 do
      liste(.j.):=liste(.j+1.);
    sidste:=sidste-1;
  end;

    function antalord: integer;
    begin
      antalord:=sidste;
    end;

    procedure storebogstaver(var s:streng);
    var
      i: integer; ch: char;
    begin
      for i:=1 to len(s) do
      begin
        ch:=s(.i.);
        if (ch>='a') and (ch<='å') then
          ch:=(chr(ord(ch)-32));
        s(.i.):=ch;
      end;
    end;

    function ord(i: integer): streng;
    begin
      ord:=liste(.i.).ord;
    end;

    function hyppighed(i: integer): integer;
    begin
      hyppighed:=liste(.i.).ant;
    end;

«eof»