Hi!
This is my program:
Code:
#include "console.h"
#include "windows.h"
int main(int argc, char* argv[])
{
initConsole();
int key;
do
{
int wysokosc=10;
setTextAttributes(FOREGROUND_BLUE| BACKGROUND_RED);
gotoXY(5,20);
for(int i=0; i<wysokosc; i++)
write('*');
gotoXY(5,20);
for(int i=0; i<wysokosc+7; i++)
{
printf("*\n");
gotoXY(5,20+i);
}
gotoXY(15,20);
for(int i=0; i<wysokosc-2; i++)
{
printf("*\n");
gotoXY(15,20+i);
}
gotoXY(6,27);
for(int i=0; i<wysokosc; i++)
write('*');
gotoXY(8,28);
for(int i=0; i<wysokosc-1; i++)
{
write('*');
gotoXY(8+i,28+i);
}
key = getVKey();
switch (key)
{
case VK_UP : clearScreen();
setTextAttributes(FOREGROUND_RED| BACKGROUND_BLUE);
gotoXY(22,20);
for(int i=0; i<wysokosc+7; i++)
{
printf("*\n");
gotoXY(22,20+i);
}
gotoXY(23,21);
for(int i=0; i<wysokosc+5; i++)
{
write('*');
gotoXY(23+i,21+i);
}
for(int i=0; i<wysokosc+6; i++)
{
printf("*\n");
gotoXY(37,34-i);
}
break;
}
}
while (key!=VK_ESCAPE);
return 0;
}
Program should change R for N written by *
If it were correct it'd change R for N when i click VK_UP. But it isn't. I don't know how to fix it.
Please, help me. Thanks