Draw Mondrian Art with coding at www.wescheme.org

Mondrian Art Example 3

The graphic image below right was created by the programming code on the left.  See below image for complete copy of the code.

 

Actual editable code http://tinyurl.com/mondrian-ex3

Ex3 screen capture

;;Coding Mondrian like art (image3)
;;This code is written to run in WeScheme programming environment
;;any word/s after semicolon is a comment, when you press enter the next lines begins as code

;;create background rectangle
(define blank (rectangle 400 400 "outline" "black"))
;;To create a graphic image, think about layering from the bottom up. 
;;This means that the last item drawn will be the first "put-image" command
;;
(define Mond3
;;top horizontal line
  (put-image  (rectangle 400 20 "solid" "black") 200 390
             
;;botom horizontal line
            (put-image  (rectangle 400 20 "solid" "black") 200 10
                       
;;left vertical line
            (put-image  (rectangle 15 400 "solid" "black")  10 200
                       
;;right vertical line
            (put-image  (rectangle 15 400 "solid" "black") 390 200
                       
;;2nd horizontal bar
            (put-image  (rectangle 400 15 "solid" "black")  200 310 
                       
;; vertical line left of red
            (put-image  (rectangle 8 80 "solid" "black") 120 345
                       
;; vertical line right of red
            (put-image  (rectangle 8 80 "solid" "black")  180 345
                       
;;red block
            (put-image  (rectangle 60 70  "solid" "red")    150 350
           
;;black bar
            (put-image (rectangle 130 10 "solid" "black")  60 358
                      
;;blue block
            (put-image (rectangle 130 20 "solid" "blue")  60 370
                                 
;;black bar below yellow
            (put-image (rectangle 230 10 "solid" "black") 120 220
                                            
;;black bar to right yellow
            (put-image (rectangle 10 360 "solid" "black") 240 140
                                            
;yellow block
            (put-image  (rectangle 230 80 "solid" "yellow") 120 260
                                                         
;; vertical line left of red/blue/yellow
            (put-image  (rectangle 8 220 "solid" "black") 120 110
                                                       
;;black bar below red
            (put-image (rectangle 130 10 "solid" "black")  180 115
                      
;;black bar above blue
            (put-image (rectangle 130 10 "solid" "black")  180 70
                      
;;black bar below blue
            (put-image (rectangle 130 10 "solid" "black")  180 40
                      
;;2nd red block
            (put-image  (rectangle 120 100 "solid" "red") 180 170
                                  
;;2nd blue block
            (put-image  (rectangle 120 30 "solid" "blue") 180  50
                                              
;;2nd yellow block
            (put-image  (rectangle 120 20 "solid" "yellow") 180 30
                                                          
 ;;3rd blue block
            (put-image  (rectangle 145 145 "solid" "blue") 320  230
                        blank))))))))))))))))))))))
Mond3