File WUR434.PS

Directory of image this file is from
This file as a plain text file

PROGRAM HAEUFIGKEIT (OUT);
CONST
N=1000;

TYPE
FELD=ARRAY [3..18] OF INTEGER;
LIST=ARRAY [1..3] OF INTEGER;

VAR
A:LIST;
C:FELD;
I,K,H,Y,Z,B:INTEGER;

FUNCTION ASUM : INTEGER;
VAR
    I,Y:INTEGER;
BEGIN
Y:=0;
FOR I:=1 TO 3 DO BEGIN
    A[I]:=TRUNC (RANDOM*6+1);
    Y:=Y+A[I]
                 END;
    ASUM:=Y
END;

(*==================Hauptprogramm==================*)
BEGIN
 FOR I:=3 TO 18 DO C[I]:=0;  (*Nullsetzen des Feldes*)

 FOR K:=1 TO  N DO BEGIN  (*Grosse FOR -Schleife*)
    H:=ASUM;C[H]:=C[H]+1;
    IF K MOD (N DIV 10)=0 THEN BEGIN
    WRITELN;
    WRITELN("  N=",K);
    WRITELN;
    WRITELN("   K    ABS H(K)    %");
      FOR I:=3 TO 18 DO BEGIN (*Kleine FOR -Schleife*)
      WRITE(I:4,C[I],C[I]/K*100:8:2);
      WRITELN
                        END;  (*Kleine FOR -Schleife*)
(*=================Graphik-Ausgabe=================*)
    FOR I:=3 TO 18 DO BEGIN
       FOR Y:=1 TO ROUND(C[I]/K*100) DO
       WRITE("*");
       WRITELN
                      END
(*=================================================*)
                END(*Ende des THEN Teils*)
                  END (*Ende der grossen FOR -Schleife*)
END.
(*=================================================*)



Feel free to contact me, David Gesswein djg@pdp8online.com with any questions, comments on the web site, or if you have related equipment, documentation, software etc. you are willing to part with.  I am interested in anything PDP-8 related, computers, peripherals used with them, DEC or third party, or documentation. 

PDP-8 Home Page   PDP-8 Site Map   PDP-8 Site Search