Source PostScript (fuz.pps)

Retour Texte non formaté
%%%%%%%%%%%%% fusion de 2 tableaux %%%%%%%%%%%%% %% syntaxe : [a1 a2][b1 b2] fuz --> [a1 b1 a2 b2] /fuz { 4 dict begin /l2 exch def /l1 exch def /i 0 def /resultat l1 length 2 mul array def l1 length { l1 i get resultat exch i 2 mul exch put l2 i get resultat exch i 2 mul 1 add exch put /i i 1 add store } repeat resultat end } def %% syntaxe : [a1 a2][b1 b2] n1 n2 Fuz /Fuz { 7 dict begin /n2 exch def /n1 exch def /l2 exch def /l1 exch def /i 0 def /resultat l1 length l2 length add array def l1 length n1 idiv { /k 0 def n1 { l1 i n1 mul k add get resultat exch i n1 mul k add i n2 mul add exch put /k k 1 add store } repeat /k 0 store n2 { l2 i n2 mul k add get resultat exch i 1 add n1 mul k add i n2 mul add exch put /k k 1 add store } repeat /i i 1 add store } repeat resultat end } def