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

⟦18a1147b9⟧ TextFile

    Length: 1408 (0x580)
    Types: TextFile
    Names: »CPRDATO.PAS«

Derivation

└─⟦3702e543b⟧ Bits:30003064 Demoprogrammer A-J til Pascal bog
    └─ ⟦this⟧ »CPRDATO.PAS« 

TextFile

PROGRAM cprdato;

  TYPE
    str6 = STRING(.6.);
    arr = ARRAY(.1 .. 6.) OF INTEGER;
    
  VAR
    str : str6;
    cif : arr;
    g, h, i, datosum, gsum, hsum, isum, check, j : INTEGER;
    ok : BOOLEAN;
    
  BEGIN
    WRITE(CLRHOM);
    REPEAT
      GOTOXY(10, 5);
      WRITE('Indtast en dato således: DDMMÅÅ');
      GOTOXY(35, 6);
      WRITE(CLREOL);
      BUFLEN := 6;
      READLN(str);
      ok := TRUE;
      IF LEN(str) < 6
        THEN ok := FALSE
        ELSE
          FOR j := 1 TO 6 DO
            IF (str(.j.) < '0') OR ('9' < str(.j.))
              THEN ok := FALSE;
    UNTIL ok;
    FOR j := 1 TO 6 DO
      cif(.j.) := ORD(str(.j.)) - ORD('0');
    datosum := cif(.1.) * 4 + cif(.2.) * 3 + cif(.3.) * 2 
             + cif(.4.) * 7 + cif(.5.) * 6 + cif(.6.) * 5;
    WRITELN;
    FOR g := 0 TO 9 DO
      BEGIN
        gsum := datosum + g * 4;
        FOR h := 0 TO 9 DO
          BEGIN
            hsum := gsum + h * 3;
            FOR i := 0 TO 9 DO
              BEGIN
                isum := hsum + i * 2;
                FOR check := 0 TO 9 DO
                  IF (isum + check) MOD 11 = 0
                    THEN WRITE(str, '-', g, h, i, check, '     ');
              END;
          END;
      END;
    WRITELN;
  END.
«eof»