## nish88

hi everyone i'm trying to make an animation and at the end i am getting a rectangle by using lots of small rectangle. it is not so attractive.
what i want is that while the animation is being performed, some of the small rectangles that i am using are deleted randomly. so that its does not get the form of a concrete rectangle.

can anyone help me to perform this task.
thank you....

here are my codes:

from Tkinter import *
import array
import time

A=[]
B=[]

C=[]
D=[]

E=[]
F=[]

G=[]
H=[]

I=[]
J=[]

frame=Tkinter.Frame()
frame.pack()

canvas =Tkinter.Canvas(frame,bg = 'white',width=500, height=500)
canvas.pack()

def calculate(a,b):
b1=b
a1=a

e1=a
f1=b

j1=b
i1=a

for j in range(50):
for i in range(10):

B.append(b)
C.append(a1)
E.append(e1)
J.append(j1)
#print len(A)

b=B[i]+4
a1=C[i]-4
e1=E[i]+4
j1=J[i]-4

x1=a+2
y1=b+2

a11=a1+2
b11=b1+2

e11=e1+2
f11=f1+2

i11=i1+2
j11=j1+2
time.sleep(0.3)

canvas.create_rectangle(a,b,x1,y1,fill="red",outline="red")
canvas.create_rectangle(a1,b1,a11,b11,fill="red",outline="red")
canvas.create_rectangle(e1,f1,e11,f11,fill="red",outline="red")
canvas.create_rectangle(i1,j1,i11,j11,fill="red",outline="red")
canvas.update()

a = a+4
b1=b1+4
f1=f1-4
i1=i1-4
A.append(a)
D.append(b1)
F.append(f1)
I.append(i1)

#canvas.create_rectangle(200,300,210,310,fill="black")

def animate():
c=200
b=300
canvas.create_oval(200,300,210,310,fill="violet", outline="violet")
calculate(c,b)

button=Tkinter.Button(frame,fg="blue", text="ANIMATE", activebackground='red',font=('verdana', 10, 'bold'),command=animate).pack(padx =50,side = LEFT)
mainloop()

## jrcagle 77

I watched it for a while and didn't see any rectangles being deleted. But you're right; the algorithm doesn't make a rectangle shape.

So what's the issue, exactly?

Jeff

## nish88

ya you are right the piece of codes for deleting rectangle is not there.
actually i am not able to write the deleting section that why i am asking someone if he or she can help me in doing it....

can anyone??????