operator: display-map

    description:
        display-map[h, w]
        display-map[h, w, op]
        display-map[h, w, op, empty-char]
        display a rectangular map, of height h, and width w
        where each cell is the value of op applied to that cell (default operator is 'value')
        where empty-char is printed for empty cells (default value of empty-char is ' ')
      
    examples:
        learn-map[5, 5, value]
        -- display an empty map:
        display-map[5, 5, value, "."]
            h: 5
            w: 5
            1     .  .  .  .  .
            2     .  .  .  .  .
            3     .  .  .  .  .
            4     .  .  .  .  .
            5     .  .  .  .  .

        -- learn some cell values:
        value |grid: 3: 1> => |H>
        value |grid: 3: 2> => |e>
        value |grid: 3: 3> => |l>
        value |grid: 3: 4> => |l>
        value |grid: 3: 5> => |o>

        -- now redraw our map:
        -- using default operator 'value', and default empty-char ' ':
        display-map[5, 5]
            h: 5
            w: 5
            1
            2
            3     H  e  l  l  o
            4
            5
                                
    see also:
        learn-map, walking-ant.swc

Home