to randomColor
make "myRed random 256
make "myGreen random 256
make "myBlue random 256
setpc (list :myRed :myGreen :myBlue)
setfc (list :myRed :myGreen :myBlue)
end
The syntax of making a list took a little while to figure out!
Supposing that you are calling the code for making a square frame in the center of the screen centerSquare, this code will fill it with color, over and over:
to go
cs
repeat 50 [
randomColor
centerSquare
fill
wait 35
]
end
No comments:
Post a Comment