Black and White
B&W shows the use of PX, a function that really invites experiments and creativity. It’s very simple. All it does is change the color of overlapping elements. If you place a black rectangle over a black circle, the overlapping area will turn white.
By using WAIT, LOOP and RANDOM an animated version of B&W can be created that will run for hours with the picture constantly changing in a stroboscopic way. In a dark room on a big screen this could make you go crazy. Be careful!
B&W starts with a striped area. Then rectangles, circles and lines are placed by using the coordinates for their position. The width of the lines is changed with SETWIDTH. Adding new figures to the program is OK and easy, just add a new program line where you want it. I seldom open my own version without putting in a new figure. B&W is just one example of the use of the PX function. There are more ideas waiting to be explored.
Logo 5 does not work very well with PX. Therefore, some of the effects are lost with Logo 5.
B&W.lgo
TO STRIBE
FS SETWIDTH 1 PU HOME
PU SETXY [-480 -300]
REPEAT 45 [PX STAMPRECT 10 600 PU RT 90 FD 10 LT 90 PX (STAMPRECT 10 600 TRUE) PU RT 90 FD 10 LT 90] PU HOME
END
TO B&W :T
FS SETPC 0 CS ht
REPEAT :T [STRIBE PU SETXY (LIST -400 -250) PX (STAMPRECT 400 400 TRUE) WAIT RANDOM 500
REPEAT 3 [PU SETXY (LIST 0 -150) PX (STAMPRECT 400 400 TRUE) WAIT RANDOM 500]
PU SETXY (LIST -200 150) PX (STAMPOVAL 100 100 TRUE) WAIT RANDOM 500
PX STRIBE PU SETXY (LIST 30 150) PX (STAMPOVAL 100 100 TRUE) WAIT RANDOM 500
REPEAT 12 [PU SETXY (LIST -200 150) PX (STAMPOVAL 100 100 TRUE) WAIT RANDOM 200]
PU SETXY (LIST 30 150) PX (STAMPOVAL 100 100 TRUE) WAIT RANDOM 500
PU SETXY (LIST 260 150) PX (STAMPOVAL 100 100 TRUE) WAIT RANDOM 500
PU SETXY (LIST -400 250) SETPC "BLACK SETWIDTH 40 SETH 120 PX FD 900 WAIT RANDOM 300
PX STRIBE WAIT RANDOM 300 PU SETXY (LIST -100 0) PX (STAMPOVAL 200 200 TRUE) WAIT RANDOM 500
REPEAT 3 [PU SETXY (LIST -450 -280) SETWIDTH 23 SETH 72 PX FD 900 WAIT RANDOM 500]
PU SETXY (LIST 200 -50) PX SETWIDTH 23 STAMPOVAL 150 150 WAIT random 300
PU PU SETXY (LIST 260 -150) PX (STAMPOVAL 100 100 TRUE) WAIT RANDOM 500
PU SETXY (LIST -400 150) SETPC "BLACK SETWIDTH 40 SETH 120 PX FD 900 WAIT RANDOM 500
REPEAT 2 [PU SETXY (LIST 200 50) PX (STAMPOVAL 200 200 TRUE) WAIT RANDOM 300]
REPEAT 12 [PU SETXY (LIST -450 0) SETWIDTH 23 SETH 72 PX FD 900 WAIT RANDOM 300]
PX STRIBE PU SETXY (LIST -200 -50) PX SETWIDTH 23 STAMPOVAL 150 150 WAIT random 500
PU PU SETXY (LIST -200 -150) PX (STAMPRECT 400 400 TRUE) WAIT RANDOM 500
REPEAT 3 [PU SETXY (LIST -300 -300) PX (STAMPRECT 400 400 TRUE) WAIT RANDOM 500]
PX STRIBE PU SETXY (LIST -150 150) PX (STAMPOVAL 100 100 TRUE) WAIT RANDOM 500
PU SETXY (LIST 130 -150) PX (STAMPOVAL 100 100 TRUE) WAIT RANDOM 500
REPEAT 3 [PU SETXY (LIST -200 0) PX (STAMPOVAL 100 100 TRUE) WAIT RANDOM 200]
PX STRIBE PU SETXY (LIST -150 -150) PX (STAMPOVAL 100 100 TRUE) WAIT RANDOM 500
PU SETXY (LIST 160 150) PX (STAMPOVAL 100 100 TRUE) WAIT RANDOM 200
PU SETXY (LIST -400 0) SETWIDTH 40 SETH 100 PX FD 800 WAIT RANDOM 200
STRIBE
REPEAT 3 [PU SETXY (LIST -200 100) PX (STAMPRECT 150 150 TRUE) WAIT RANDOM 500]
REPEAT 3 [PU SETXY (LIST -450 -250) SETWIDTH 23 SETH 80 PX FD 800 WAIT RANDOM 300]
repeat 8[pu setxy (list 405 -280) setpc "red setwidth 20 pd dot getxy wait random 300 setpc "white dot getxy ]setwidth 1 pu wait 200]
END
Procedure | B&W 1 |
Description | Black and White Art |
Level | Beginner |
Tags | Art |