Witam chciałem stworzyć program, który rysowałby pionową kreske a po dojściu owej kreski do jakiegoś punktu rysowałaby się druga kreska równolegle z tą pierwszą ale coś nie idze :-/ Oto kod:
#include <iostream>
#include <cstdlib>
#include <winbgim.h>
using namespace std;
int main(int argc, char *argv[])
{
int x = 0,y;
initwindow(400,300);
setfillstyle(SOLID_FILL, BLUE);
bar (0,0,getmaxx(),getmaxy());
while (x < 50)
{
putpixel(30,x+40,GREEN);
cout << x;
x++;
delay(100);
while (x >= 20)
{
putpixel(50,60,GREEN);
cout << y;
y++;
delay(100);
}
}
while(!kbhit());
closegraph();
system("PAUSE");
return 0;
}