#include<graphics.h>
#include<conio.h>
#include<dos.h>
#include<iostream.h>
class mball
{
private:
int x,y,dx,dy,R;
public:
void Show();
void hide();
void move();
mball(int a,int b,int c);
};
mball::mball(int a,int b,int c)
{
x=a;
y=b;
R=c;
dx=dy=50;
}
void mball::Show()
{
setcolor(15);
circle(x,y,R);
}
void mball::hide()
{
setcolor(0);
circle(x,y,R);
}
void mball::move()
{
hide();
x=+dx;
y+=dy;
if(x>640-R || x<R)
dx =-dx;
if(y>480-R || y<R)
dy =-dy;
Show();
delay(100);
}
void main()
{
int g=0,m;
initgraph(,&g,&m);
mball P(320,240,50);
P.Show();
while(kbhit())
P.move();
delay(100);
}
}هذا هو كود رسم الاشكال الهندسيه اللذي كتبته
اتمنى اذا كان هنالك خطا بالشيفره اعلامي بها
كذلك لدي سؤال لماذا لا استطيع ان ارى نتائج البرنامج؟
----