Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

all-corners function

    all-corners: func [
       {Returns all corners of the rectangle
        given the upper-left and lower-right corners.}
       ul [pair!] "The upper-left corner of the rectangle"
       lr [pair!] "The bottom-right corner of the rectangle"
       /local result
    ][
        result: make block! 4
        repend result [
            ul
            to-pair compose [(first ul) (second lr)]  ;ur
            to-pair compose [(first lr) (second ul)]  ;ll
            lr
        ]
        return result
    ]
    ; example: all-corners 0x0 10x10
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS