⍝ Postage stamps to the value of ⍵:

    ⍕{disp 2 0∘⍕¨stamps ⍵}¨50 51 52 53          ⍝ default UK(1998) stamps
 ┌──┬──┬──┐  ┌──┬──┬──┐  ┌──┬──┐  ┌──┬──┐ 
 │43│ 6│ 1│  │39│ 6│ 6│  │26│26│  │43│10│ 
 └──┴──┴──┘  └──┴──┴──┘  └──┴──┘  └──┴──┘ 

    bins←1 2 4 8 16 32                          ⍝ "binary" stamps:

    ⍕{disp 2 0∘⍕¨bins stamps ⍵}¨15 16 17 18
 ┌──┬──┬──┬──┐  ┌──┐  ┌──┬──┐  ┌──┬──┐ 
 │ 8│ 4│ 2│ 1│  │16│  │16│ 1│  │16│ 2│ 
 └──┴──┴──┴──┘  └──┘  └──┴──┘  └──┴──┘ 

    bts←1 ¯1 3 ¯3 9 ¯9 27 ¯27                   ⍝ "balanced tertiary" stamps
    ⍕{disp 2 0∘⍕¨bts stamps ⍵}¨12 13 14 15      ⍝ (see: eval.dws/notes.bta)
 ┌──┬──┐  ┌──┬──┬──┐  ┌──┬──┬──┬──┐  ┌──┬──┬──┐ 
 │ 9│ 3│  │ 9│ 3│ 1│  │27│¯1│¯3│¯9│  │27│¯3│¯9│ 
 └──┴──┘  └──┴──┴──┘  └──┴──┴──┴──┘  └──┴──┴──┘ 

⍝∇ stamps path

Back to: code

Back to: Workspaces