I am making Langton's Ant in C++, when I try to draw squares, I can. But I can't make this in loop.
for(int i = 0;i<=100;i++){
rectangle( image, Point( i*5, 0 ), Point( (i*5)+5, 5), Scalar( 0, 55, 255 ), CV_FILLED, 4 );
imshow("kare",image);
Sleep(100);
}
It waits for 10 seconds, then draw all the squares same time. If I add cvWaitKey(0);
before sleep, I get same problem. When I "touch" the key, it draw, but when I hold, it doesn't draw. When I back off my finger, it draw.
How can I solve it? Regards.