In text mode the demisions are 25x80 or x:80 y:25, right? Then why is writing to the 25th row using the code below causing it to scroll?
Code:
#include <stdio.h>
#include <conio.h>
void drawScore(void);
void drawBorder(void);
struct playerData {
int x,y,score;
int oldy;
};
struct playerData player1 = {3,10}, player2 = {78,10};
main()
{
drawScore();
drawBorder();
getch();
}
void drawScore(void)
{
gotoxy(3,1);
printf("Player 1");
gotoxy(3,2);
printf("Score: %d", player1.score);
gotoxy(20,1);
printf("x: %d y: %d ", player1.x, player1.y);
gotoxy(71,1);
printf("Player 2");
gotoxy(71,2);
printf("Score: %d", player2.score);
gotoxy(40,1);
printf("x: %d y: %d ", player2.x, player2.y);
}
void drawBorder(void)
{ int i;
gotoxy(1,3);
for(i = 0; i < 80;i++)
printf("=");
gotoxy(1,25);
for(i = 0; i < 80;i++)
printf("=");
}