Explore
Courses
Batches
Sketches
Statistics
Code a Pookkalam
Jobs
Devsprint
People
Course Creation
Create a Course
Guidelines
Resources
Support
Blogs
My Profile
About Us
Login
Sketches
0
tinker Hub with random colours
By
Devjith P
Run
def rand_colour(): return random(0,225) fill1=color(r=rand_colour(),g=rand_colour(),b=rand_colour()) fill2=color(r=rand_colour(),g=rand_colour(),b=rand_colour()) fill3=color(r=rand_colour(),g=rand_colour(),b=rand_colour()) fill4=color(r=rand_colour(),g=rand_colour(),b=rand_colour()) fill5=color(r=rand_colour(),g=rand_colour(),b=rand_colour()) fill6=color(r=rand_colour(),g=rand_colour(),b=rand_colour()) fill7=color(r=rand_colour(),g=rand_colour(),b=rand_colour()) fill8=color(r=rand_colour(),g=rand_colour(),b=rand_colour()) fill9=color(r=rand_colour(),g=rand_colour(),b=rand_colour()) background_=rectangle(h=300,w=300,fill="white") r1=rectangle(h=50,w=12,fill=fill1,stroke="None")+rectangle(y=25,h=10,w=50,fill=fill1,stroke="None") T=r1|translate(x=-124) r2=rectangle(h=50,w=12,fill=fill2,stroke="None") I=r2|translate(x=-84) r3=rectangle(h=50,w=12,fill=fill3,stroke="None")+(rectangle(x=13,y=-7,h=50,w=12,fill=fill3,stroke="None")|rotate(30)|scale(0.9))+(rectangle(h=50,w=12,fill=fill3,stroke="None")|translate(x=26)) N=r3|translate(x=-50) r4=rectangle(h=50,w=12,fill=fill4,stroke="None")+(rectangle(x=1,y=15,h=32,w=12,fill=fill4,stroke="None")|rotate(-40)|scale(0.9))+(rectangle(x=2,y=-13,h=40,w=12,fill=fill4,stroke="None")|rotate(40)|scale(0.9)) K=r4|translate(x=0) E=rectangle(x=50,y=20,h=10,w=30,fill=fill5,stroke="None")+(rectangle(h=10,w=40,fill=fill5,stroke="None")|rotate(90)|translate(x=40))+rectangle(x=50,y=-20,h=10,w=30,fill=fill5,stroke="None")+rectangle(x=50,h=10,w=30,fill=fill5,stroke="None") r5=rectangle(h=50,w=12,fill=fill6,stroke="None")+(rectangle(x=2,y=-13,h=40,w=12,fill=fill6,stroke="None")|rotate(40)|scale(0.9)) R1=r5|translate(x=90) r6=circle(x=105,r=20,fill=fill6,stroke="None")+ellipse(x=95,h=25,w=40,fill="white",stroke="None") R2=r6|scale(0.8)|translate(x=13,y=10) r7=rectangle(h=50,w=12,y=-100,fill=fill7,stroke="None")+(rectangle(x=-145,y=-20,h=50,w=10,fill=fill7,stroke="None")|rotate(90)|scale(0.7))+rectangle(h=50,w=12,x=30,y=-100,fill=fill7,stroke="None") H=r7|translate(x=-75) U=ellipse(w=40,h=60,y=-95,fill=fill8,stroke="None")+(ellipse(w=30,h=60,y=-135,fill="white",stroke="None")|scale(0.7))+rectangle(y=-70,h=20,w=40,fill="white",stroke="none") r8=circle(x=50,y=-90,r=16,fill=fill9,stroke="None")+ellipse(x=50,y=-90,h=15,w=18,fill="white",stroke="None")+circle(x=50,y=-113,r=16,fill=fill9,stroke="None")+ellipse(x=50,y=-113,h=15,w=18,fill="white",stroke="None")+rectangle(x=38,y=-102,h=52,w=10,fill=fill9,stroke="None") B=r8|scale(0.9)|translate(y=-7) show(background_,T,I,N,K,E,R2,R1,H,U,B)
Comments
Want to discuss?
Post it here, our mentors will help you out.
Login