I have this program where an "x" bounces around the screen. It will bounce around the screen properly for about a minute or so but then suddenly it will bounce off of the screen and it will come back and draw a million x'es around the screen. this is the code i am using:
Code:
        Sleep(50);
        clearEnemy();
        --w;
        ++v;
        printEnemy();
        if(w == 2)
        {
            side = 'l';
            break;
        }
        
        if(v == 68)
        {
            ++v;
            side = 'b';
            break;
        }
This block of code is supposed to bounce the "x" to the top right of the screen( w is supposed to be the y coordinate and v is supposed to be the x coordinate). It will properly work at first but when it hits the bottom right corner of the screen it will then bounce to the top right and just keep on going off of the screen.

Code:
     #
     #
     #
     #< this is where it would bounce off of the screen
     #
######
   ^
this is where it would hit
Any suggestions on why this would happen? If that was a little too vague for you just tell me cause i am never too good on details.