DataMuseum.dk

Presents historical artifacts from the history of:

MIKADOS

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

See our Wiki for more about MIKADOS

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦ffd7f00d0⟧ TextFile

    Length: 2528 (0x9e0)
    Types: TextFile
    Notes: Mikados_K
    Names: »FLETNING.K«

Derivation

└─⟦4cd80c18f⟧ Bits:30003895/4xCOMAL3a.imd 4 * COMAL - SPC/1 - Disketter til bogen
    └─⟦this⟧ »FLETNING.K« 
└─⟦bcf7b34c7⟧ Bits:30003895/4xCOMAL2.imd 4 * COMAL - SPC/1 - Disketter til bogen
    └─⟦this⟧ »FLETNING.K« 

Mikados K File

0100 // Programmet udgået, da denne COMAL-version ikke kan arbejde med
0110 // recursive procedurer

Mikados K File

0x000…048 Line {l1=0x46, l2=»0100 // Programmet udgået, da denne COMAL-version ikke kan arbejde med«, l3=0x46}
0x048…066 Line {l1=0x1c, l2=»0110 // recursive procedurer«, l3=0x1c}
0x066…080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                     ┆                          ┆
0x080…0a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ┆                                ┆
          […0x1…]
0x0c0…0e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 30   ┆                               0┆
0x0e0…100 30 35 30 20 50 52 4f 43 20 53 4f 52 54 45 52 28 56 2c 20 48 2c 20 52 45 46 20 54 28 29 29 20 43   ┆050 PROC SORTER(V, H, REF T()) C┆
0x100…120 4c 4f 53 45 44 26 4c 30 30 36 30 20 20 2f 2f 20 50 72 6f 63 65 64 75 72 65 6e 20 73 6f 72 74 65   ┆LOSED&L0060  // Proceduren sorte┆
0x120…140 72 65 72 20 65 6c 65 6d 65 6e 74 65 72 6e 65 20 69 20 74 2d 74 61 62 65 6c 20 66 72 61 20 65 6c   ┆rer elementerne i t-tabel fra el┆
0x140…160 65 6d 65 6e 74 20 64 72 2e 20 76 3d 76 65 6e 73 74 72 65 4c 4a 30 30 37 30 20 20 2f 2f 20 74 69   ┆ement dr. v=venstreLJ0070  // ti┆
0x160…180 6c 20 65 6c 65 6d 65 6e 74 20 6e 72 2e 20 68 3d 68 7c 6a 72 65 2e 20 50 72 6f 63 65 64 75 72 65   ┆l element nr. h=højre. Procedure┆
0x180…1a0 6e 20 68 65 72 20 65 72 20 6b 65 6e 64 74 20 73 6f 6d 20 27 71 75 69 63 6b 73 6f 72 74 27 2e 4a   ┆n her er kendt som 'quicksort'.J┆
0x1a0…1c0 43 30 30 38 30 20 20 2f 2f 20 44 65 6e 20 65 72 20 73 76 7b 72 20 61 74 20 66 6f 72 73 74 7d 2c   ┆C0080  // Den er svær at forstå,┆
0x1c0…1e0 20 6d 65 6e 20 74 69 6c 20 67 7b 6c 64 69 67 20 68 75 72 74 69 67 2e 20 44 65 6e 20 6b 61 6e 20   ┆ men til gældig hurtig. Den kan ┆
0x1e0…200 65 76 74 2e 43 2c 30 30 39 30 20 20 2f 2f 20 65 72 73 74 61 74 74 65 73 20 61 66 20 65 6e 20 73   ┆evt.C,0090  // erstattes af en s┆
0x200…220 69 6d 70 6c 65 72 65 20 73 6f 72 74 65 72 69 6e 67 2e 2c 10 30 31 30 30 20 20 49 3a 3d 56 3b 20   ┆implere sortering., 0100  I:=V; ┆
0x220…240 4a 3a 3d 48 10 17 30 31 31 30 20 20 58 3a 3d 54 28 28 49 2b 4a 29 20 44 49 56 20 32 29 17 0d 30   ┆J:=H  0110  X:=T((I+J) DIV 2)  0┆
0x240…260 31 32 30 20 20 52 45 50 45 41 54 20 0d 17 30 31 33 30 20 20 20 57 48 49 4c 45 20 54 28 49 29 3c   ┆120  REPEAT   0130   WHILE T(I)<┆
0x260…280 58 20 44 4f 20 17 0e 30 31 34 30 20 20 20 20 49 3a 3d 49 2b 31 0e 10 30 31 35 30 20 20 20 45 4e   ┆X DO   0140    I:=I+1  0150   EN┆
0x280…2a0 44 57 48 49 4c 45 20 10 17 30 31 36 30 20 20 20 57 48 49 4c 45 20 58 3c 54 28 4a 29 20 44 4f 20   ┆DWHILE   0160   WHILE X<T(J) DO ┆
0x2a0…2c0 17 0e 30 31 37 30 20 20 20 20 4a 3a 3d 4a 2d 31 0e 10 30 31 38 30 20 20 20 45 4e 44 57 48 49 4c   ┆  0170    J:=J-1  0180   ENDWHIL┆
0x2c0…2e0 45 20 10 14 30 31 39 30 20 20 20 49 46 20 49 3c 3d 4a 20 54 48 45 4e 20 14 24 30 32 30 30 20 20   ┆E   0190   IF I<=J THEN  $0200  ┆
0x2e0…300 20 20 41 3a 3d 54 28 49 29 3b 20 54 28 49 29 3a 3d 54 28 4a 29 3b 20 54 28 4a 29 3a 3d 41 24 0e   ┆  A:=T(I); T(I):=T(J); T(J):=A$ ┆
0x300…320 30 32 31 30 20 20 20 20 49 3a 3d 49 2b 31 0e 0e 30 32 32 30 20 20 20 20 4a 3a 3d 4a 2d 31 0e 0d   ┆0210    I:=I+1  0220    J:=J-1  ┆
0x320…340 30 32 33 30 20 20 20 45 4e 44 49 46 20 0d 0f 30 32 34 30 20 20 55 4e 54 49 4c 20 49 3e 4a 0f 24   ┆0230   ENDIF   0240  UNTIL I>J $┆
0x340…360 30 32 35 30 20 20 49 46 20 56 3c 4a 20 54 48 45 4e 20 45 58 45 43 20 53 4f 52 54 45 52 28 56 2c   ┆0250  IF V<J THEN EXEC SORTER(V,┆
0x360…380 4a 2c 54 29 24 24 30 32 36 30 20 20 49 46 20 49 3c 48 20 54 48 45 4e 20 45 58 45 43 20 53 4f 52   ┆J,T)$$0260  IF I<H THEN EXEC SOR┆
0x380…3a0 54 45 52 28 49 2c 48 2c 54 29 24 13 30 32 37 30 20 45 4e 44 50 52 4f 43 20 53 4f 52 54 45 52 13   ┆TER(I,H,T)$ 0270 ENDPROC SORTER ┆
0x3a0…3c0 35 30 32 38 30 20 2f 2f 20 46 7c 72 73 74 20 73 6b 61 6c 20 76 69 20 73 6b 61 66 66 65 20 6f 73   ┆50280 // Først skal vi skaffe os┆
0x3c0…3e0 20 32 20 73 6f 72 74 65 72 65 64 65 20 74 61 62 65 6c 6c 65 72 3a 35 07 30 32 39 30 20 2f 2f 07   ┆ 2 sorterede tabeller:5 0290 // ┆
0x3e0…400 0b 30 33 30 30 20 43 4c 45 41 52 20 0b 0b 30 33 31 30 20 54 41 42 3a 3d 36 0b 47 30 33 32 30 20   ┆ 0300 CLEAR   0310 TAB:=6 G0320 ┆
0x400…420 49 4e 50 55 54 20 22 49 6e 64 74 61 73 74 20 61 6e 74 61 6c 6c 65 74 20 61 66 20 65 6c 65 6d 65   ┆INPUT "Indtast antallet af eleme┆
0x420…440 6e 74 65 72 20 69 20 64 65 20 74 6f 20 74 61 62 65 6c 6c 65 72 3a 20 20 20 22 3a 20 4e 31 2c 20   ┆nter i de to tabeller:   ": N1, ┆
0x440…460 4e 32 47 32 30 33 33 30 20 44 49 4d 20 54 41 42 45 4c 31 28 4e 31 2b 31 29 2c 20 54 41 42 45 4c   ┆N2G20330 DIM TABEL1(N1+1), TABEL┆
0x460…480 32 28 4e 32 2b 31 29 2c 20 54 41 42 45 4c 33 28 4e 31 2b 4e 32 29 32 0c 30 33 34 30 20 52 41 4e   ┆2(N2+1), TABEL3(N1+N2)2 0340 RAN┆
0x480…4a0 44 4f 4d 20 0c 0c 30 33 35 30 20 54 41 42 45 3a 3d 34 0c 17 30 33 36 30 20 46 4f 52 20 49 3a 3d   ┆DOM   0350 TABE:=4  0360 FOR I:=┆
0x4a0…4c0 31 20 54 4f 20 4e 31 20 44 4f 20 17 1c 30 33 37 30 20 20 54 41 42 45 4c 31 28 49 29 3a 3d 52 4e   ┆1 TO N1 DO   0370  TABEL1(I):=RN┆
0x4c0…4e0 44 28 30 2c 31 30 30 30 29 1c 0b 30 33 38 30 20 4e 45 58 54 20 49 0b 17 30 33 39 30 20 46 4f 52   ┆D(0,1000)  0380 NEXT I  0390 FOR┆
0x4e0…500 20 49 3a 3d 31 20 54 4f 20 4e 32 20 44 4f 20 17 1c 30 34 30 30 20 20 54 41 42 45 4c 32 28 49 29   ┆ I:=1 TO N2 DO   0400  TABEL2(I)┆
0x500…520 3a 3d 52 4e 44 28 30 2c 31 30 30 30 29 1c 0b 30 34 31 30 20 4e 45 58 54 20 49 0b 1d 30 34 32 30   ┆:=RND(0,1000)  0410 NEXT I  0420┆
0x520…540 20 45 58 45 43 20 53 4f 52 54 45 52 28 31 2c 4e 31 2c 54 41 42 45 4c 31 29 1d 1d 30 34 33 30 20   ┆ EXEC SORTER(1,N1,TABEL1)  0430 ┆
0x540…560 45 58 45 43 20 53 4f 52 54 45 52 28 31 2c 4e 32 2c 54 41 42 45 4c 32 29 1d 0b 30 34 34 30 20 50   ┆EXEC SORTER(1,N2,TABEL2)  0440 P┆
0x560…580 52 49 4e 54 20 0b 16 30 34 35 30 20 50 52 49 4e 54 20 22 54 61 62 65 6c 20 31 3a 20 22 16 17 30   ┆RINT   0450 PRINT "Tabel 1: "  0┆
0x580…5a0 34 36 30 20 46 4f 52 20 49 3a 3d 31 20 54 4f 20 4e 31 20 44 4f 20 17 16 30 34 37 30 20 20 50 52   ┆460 FOR I:=1 TO N1 DO   0470  PR┆
0x5a0…5c0 49 4e 54 20 54 41 42 45 4c 31 28 49 29 2c 16 0b 30 34 38 30 20 4e 45 58 54 20 49 0b 0b 30 34 39   ┆INT TABEL1(I),  0480 NEXT I  049┆
0x5c0…5e0 30 20 50 52 49 4e 54 20 0b 0b 30 35 30 30 20 50 52 49 4e 54 20 0b 16 30 35 31 30 20 50 52 49 4e   ┆0 PRINT   0500 PRINT   0510 PRIN┆
0x5e0…600 54 20 22 54 61 62 65 6c 20 32 3a 20 22 16 17 30 35 32 30 20 46 4f 52 20 49 3a 3d 31 20 54 4f 20   ┆T "Tabel 2: "  0520 FOR I:=1 TO ┆
0x600…620 4e 32 20 44 4f 20 17 16 30 35 33 30 20 20 50 52 49 4e 54 20 54 41 42 45 4c 32 28 49 29 2c 16 0b   ┆N2 DO   0530  PRINT TABEL2(I),  ┆
0x620…640 30 35 34 30 20 4e 45 58 54 20 49 0b 0b 30 35 35 30 20 50 52 49 4e 54 20 0b 07 30 35 36 30 20 2f   ┆0540 NEXT I  0550 PRINT   0560 /┆
0x640…660 2f 07 48 30 35 37 30 20 2f 2f 20 46 7c 72 73 74 20 6e 75 20 66 6c 65 74 74 65 73 20 74 61 62 65   ┆/ H0570 // Først nu flettes tabe┆
0x660…680 6c 20 31 20 6f 67 20 74 61 62 65 6c 20 32 20 73 61 6d 6d 65 6e 2e 20 42 65 6d 7b 72 6b 2c 20 61   ┆l 1 og tabel 2 sammen. Bemærk, a┆
0x680…6a0 74 20 64 65 72 20 66 7c 72 73 74 48 32 30 35 38 30 20 2f 2f 20 66 7c 6a 65 73 20 65 74 20 27 73   ┆t der førstH20580 // føjes et 's┆
0x6a0…6c0 74 6f 72 74 27 20 65 6c 65 6d 65 6e 74 20 74 69 6c 20 69 20 68 76 65 72 20 74 61 62 65 6c 2e 32   ┆tort' element til i hver tabel.2┆
0x6c0…6e0 07 30 35 39 30 20 2f 2f 07 28 30 36 30 30 20 54 41 42 45 4c 31 28 4e 31 2b 31 29 3a 3d 54 41 42   ┆ 0590 // (0600 TABEL1(N1+1):=TAB┆
0x6e0…700 45 4c 31 28 4e 31 29 2b 54 41 42 45 4c 32 28 4e 32 29 28 28 30 36 31 30 20 54 41 42 45 4c 32 28   ┆EL1(N1)+TABEL2(N2)((0610 TABEL2(┆
0x700…720 4e 32 2b 31 29 3a 3d 54 41 42 45 4c 31 28 4e 31 29 2b 54 41 42 45 4c 32 28 4e 32 29 28 07 30 36   ┆N2+1):=TABEL1(N1)+TABEL2(N2)( 06┆
0x720…740 32 30 20 2f 2f 07 15 30 36 33 30 20 50 49 4c 31 3a 3d 31 3b 20 50 49 4c 32 3a 3d 31 15 1d 30 36   ┆20 //  0630 PIL1:=1; PIL2:=1  06┆
0x740…760 34 30 20 46 4f 52 20 50 49 4c 33 3a 3d 31 20 54 4f 20 4e 31 2b 4e 32 20 44 4f 20 1d 28 30 36 35   ┆40 FOR PIL3:=1 TO N1+N2 DO  (065┆
0x760…780 30 20 20 49 46 20 54 41 42 45 4c 31 28 50 49 4c 31 29 3e 54 41 42 45 4c 32 28 50 49 4c 32 29 20   ┆0  IF TABEL1(PIL1)>TABEL2(PIL2) ┆
0x780…7a0 54 48 45 4e 20 28 21 30 36 36 30 20 20 20 54 41 42 45 4c 33 28 50 49 4c 33 29 3a 3d 54 41 42 45   ┆THEN (!0660   TABEL3(PIL3):=TABE┆
0x7a0…7c0 4c 32 28 50 49 4c 32 29 21 13 30 36 37 30 20 20 20 50 49 4c 32 3a 3d 50 49 4c 32 2b 31 13 0b 30   ┆L2(PIL2)! 0670   PIL2:=PIL2+1  0┆
0x7c0…7e0 36 38 30 20 20 45 4c 53 45 20 0b 21 30 36 39 30 20 20 20 54 41 42 45 4c 33 28 50 49 4c 33 29 3a   ┆680  ELSE  !0690   TABEL3(PIL3):┆
0x7e0…800 3d 54 41 42 45 4c 31 28 50 49 4c 31 29 21 13 30 37 30 30 20 20 20 50 49 4c 31 3a 3d 50 49 4c 31   ┆=TABEL1(PIL1)! 0700   PIL1:=PIL1┆
0x800…820 2b 31 13 0c 30 37 31 30 20 20 45 4e 44 49 46 20 0c 0e 30 37 32 30 20 4e 45 58 54 20 50 49 4c 33   ┆+1  0710  ENDIF   0720 NEXT PIL3┆
0x820…840 0e 0b 30 37 33 30 20 50 52 49 4e 54 20 0b 2e 30 37 34 30 20 50 52 49 4e 54 20 22 53 61 6d 6d 65   ┆  0730 PRINT  .0740 PRINT "Samme┆
0x840…860 6e 66 6c 65 74 6e 69 6e 67 65 6e 20 61 66 20 64 65 20 74 61 62 65 6c 6c 65 72 3a 20 22 2e 1a 30   ┆nfletningen af de tabeller: ". 0┆
0x860…880 37 35 30 20 46 4f 52 20 49 3a 3d 31 20 54 4f 20 4e 31 2b 4e 32 20 44 4f 20 1a 16 30 37 36 30 20   ┆750 FOR I:=1 TO N1+N2 DO   0760 ┆
0x880…8a0 20 50 52 49 4e 54 20 54 41 42 45 4c 33 28 49 29 2c 16 0b 30 37 37 30 20 4e 45 58 54 20 49 0b 00   ┆ PRINT TABEL3(I),  0770 NEXT I  ┆
0x8a0…8c0 00 54 20 50 49 4c 33 06 0b 30 37 33 30 20 50 52 49 4e 54 20 0b 1b 30 37 34 30 20 50 52 49 4e 54   ┆ T PIL3  0730 PRINT   0740 PRINT┆
0x8c0…8e0 20 22 53 61 6d 6d 65 6e 66 6c 65 74 6e 69 6e 67 20 1b 00 00 63 63 63 63 63 63 63 63 63 63 63 63   ┆ "Sammenfletning    cccccccccccc┆
0x8e0…900 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63   ┆cccccccccccccccccccccccccccccccc┆
          […0x7…]

Reduced view