یک برنامه ی screea saver به زبان cدارم که error نمی ده اما اجرا هم نمی شه.
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<dos.h>
void main()
{
int random_y1,random_y2,random_x1,random_x2,w_y,w_x,x,y;
clrscr();
randomize();
{
w_x=wherex()-3;
w_y=wherey();
gotoxy(w_x+x,w_y+y);
/* textcolor(1+random 3);*/
printf("mr");
}
/********** if text wherex=0 **************/
if(wherex()<=7)
{
sound(200);
random_x1=random(2);
if(random_x1==1)
{;x=1;y=1;}
if (random_x1==0)
{;x=1;y=-1;}
}
/************ if text wherex=80 ***********/
if (wherex()>=78)
{
sound(500);
random_x2=random(2);
if(random_x2==1)
{x=-1;y=-1;}
if(random_x2==0)
{;x=-1;y=-1;}
}
/********** if text wherey=0 ***********/
if(wherey()==1)
{
sound(800);
random_y1=random(2);
if(random_y1==1)
{;y=1;x=-1;}
if(random_y1==0)
{;y=1;x=1;}
}
/************** if text wherey=25 ************/
if(wherey()==25)
{
sound(1200);
random_y2=random(2);
if(random_y2==1)
{;y=-1;x=-1;}
if(random_y2==0)
{;y=1;x=1;}
}
delay(190);
nosound();
kbhit();
}
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<dos.h>
void main()
{
int random_y1,random_y2,random_x1,random_x2,w_y,w_x,x,y;
clrscr();
randomize();
{
w_x=wherex()-3;
w_y=wherey();
gotoxy(w_x+x,w_y+y);
/* textcolor(1+random 3);*/
printf("mr");
}
/********** if text wherex=0 **************/
if(wherex()<=7)
{
sound(200);
random_x1=random(2);
if(random_x1==1)
{;x=1;y=1;}
if (random_x1==0)
{;x=1;y=-1;}
}
/************ if text wherex=80 ***********/
if (wherex()>=78)
{
sound(500);
random_x2=random(2);
if(random_x2==1)
{x=-1;y=-1;}
if(random_x2==0)
{;x=-1;y=-1;}
}
/********** if text wherey=0 ***********/
if(wherey()==1)
{
sound(800);
random_y1=random(2);
if(random_y1==1)
{;y=1;x=-1;}
if(random_y1==0)
{;y=1;x=1;}
}
/************** if text wherey=25 ************/
if(wherey()==25)
{
sound(1200);
random_y2=random(2);
if(random_y2==1)
{;y=-1;x=-1;}
if(random_y2==0)
{;y=1;x=1;}
}
delay(190);
nosound();
kbhit();
}