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
gift
By
Aryalekshmi
Run
# the beside, below and grid functions are already defined for you def beside(a, b): a1 = a | scale(x=0.5) | translate(x=-75) b1 = b | scale(x=0.5) | translate(x=75) return a1 + b1 r1=rectangle(x=72,y=72,w=150,h=150,fill="brown") r2=rectangle(x=72,y=-72,w=150,h=150,fill="skyblue") r3=rectangle(x=-72,y=72,w=150,h=150,fill="skyblue") r4=rectangle(x=-72,y=-72,w=150,h=150,fill="brown") show(r1,r2,r3,r4) def below(a, b): a1 = a | scale(y=0.5) | translate(y=75) b1 = b | scale(y=0.5) | translate(y=-75) return a1 + b1 def grid(a, b, c, d): return below( beside(a, b), beside(c, d)) # define the repeat64 function here def repeat64(ball): ball1 = grid(ball,ball,ball,ball) ball2 = grid(ball,ball,ball,ball) ball3 = grid(ball,ball,ball,ball) ball4 = grid(ball,ball,ball,ball) balla = grid(ball1,ball2,ball3,ball4) ball5 = grid(ball,ball,ball,ball) ball6 = grid(ball,ball,ball,ball) ball7 = grid(ball,ball,ball,ball) ball8 = grid(ball,ball,ball,ball) ballb = grid(ball5,ball6,ball7,ball8) ball9 = grid(ball,ball,ball,ball) ball10 = grid(ball,ball,ball,ball) ball11 = grid(ball,ball,ball,ball) ball12 = grid(ball,ball,ball,ball) ballc = grid(ball9,ball10,ball11,ball12) ball13 = grid(ball,ball,ball,ball) ball14 = grid(ball,ball,ball,ball) ball15 = grid(ball,ball,ball,ball) ball16 = grid(ball,ball,ball,ball) balld = grid(ball1,ball2,ball3,ball4) ball=grid(balla,ballb,ballc,balld) return ball #hat p1 = point(x=0,y=150) p2 = point(x=70,y=0) p3 = point(x=-70,y=0) p4 = point(x=35,y=70) p5 = point(x=35,y=0) p6 = point(x=-50,y=20) p7 = point(x=-35,y=70) p8 = point(x=-35,y=0) p9 = point(x=50,y=20) # make a ball and cycle of it ball = polygon ([p1,p2,p3],fill="red")+circle(r=20,fill="white",x=0,y=150)+ rectangle(x=0, y=0, w=150,h=30, fill="white")|rotate(45) s1 = repeat64(ball) show(s1) t1=polygon ([p4,p5,p6],fill="gold")+polygon ([p7,p8,p9],fill="gold")+rectangle(w=100,h=100,fill="blue")+rectangle(w=100,h=30,fill="gold")+rectangle(w=30,h=100,fill="gold") show(t1)
Comments
Want to discuss?
Post it here, our mentors will help you out.
Login