Make a Bubble-wrap simulator Bubble-wraps are maximum-level entertainment. Everyone can agree to that.
Now, you will make even computers enjoy bubble-wraps.
Specs
You will be given two integers, w, and h.(each are responsively width and height)
Your program should output all w*h phases waiting 1 second between each one and terminate.
Every bubble-wrap starts with all cells full.
For example, a 4*6 bubble-wrap starts like:
O_O_
_O_O
O_O_
_O_O
O_O_
_O_O

And each phase, a random non-popped cell is popped.For example,
O_O_
_O_O
O_X_
_O_O
O_O_
_O_O

The program should terminate when all the cells are popped. aka.
X_X_
_X_X
X_X_
_X_X
X_X_
_X_X

Examples
(4,6)
(5,5)
(6,2)
(10,10)
(7,9)
C (Windows), 260 248 bytes

#import&lt;windows.h&gt;
i,j,l,r;b(w,h){char*s=malloc(l=w*h+h);for(i=h;i--;*s++=10)for(j=w;j--;*s++=i%2^j%2?79:45);*(s-1)=0;s-=l;for(srand(time(0));j&gt;system("cls")+puts(s)-2;j&gt;-1?s[j]=88:0)for(Sleep(1000),r=rand(),j=-2,i=r+l*2;--i-r;j=s[i%l]==79?i%l:j);}