Tuesday 21 July 2015

Screen Saver in C language

Program for making screen saver effect in C Language

As mentioned in all the other programs on my blog do remember to change the path in initgraph().

Here's the code, save it as .C and enjoy!! :)
If you followed correctly, you will get an output something like this-
Computer graphics, Screen Saver
  



#include <stdio.h>
#include <stdlib.h>
#include <graphics.h>
#include <conio.h>

void main(){
int gdriver=DETECT,gmode,col=480,row=640,font=4,direction=2,size=8,color=15;
initgraph(&gdriver,&gmode,"C:\\TurboC3\\BGI");
cleardevice();
while(!kbhit()){
    settextstyle(random(font),random(direction),random(size));
    setcolor(random(color));
    outtextxy(random(col),random(row),"ShadowHack");
    delay(250);
}
closegraph();
}


You can change the text appearing in bold letters to whatever text you want to show in the screen saver.

No comments:

Post a Comment