| CODE |
| #include <windows.h> // for windows cursor function #include <iostream> // for cout using namespace std; void gotoxy(int x, int y) // this gotoxyfunction by josh woods { COORD coor; // X,Y coordinate handler HANDLE hOutput; // get variable handler for screen hOutput = GetStdHandle(STD_OUTPUT_HANDLE); // assign screen handler coor.X = x; // assign coordinate X coor.Y = y; // assign coordinate Y SetConsoleCursorPosition(hOutput,coor); // call cursor position with screen handler and coordinates } void percentometer() { gotoxy (8,8); cout << "Deleting C:\\"; gotoxy (13,10); cout << "10%"; gotoxy(5,9); cout<<"Û";// makes a block. also try other odd charachters like ° ± ² Sleep(1000); gotoxy (13,10); cout << "15%"; gotoxy(6,9); cout<<"Û"; Sleep(1000); gotoxy (13,10); cout << "20%"; gotoxy(7,9); cout<<"Û";//5°±² Sleep(1000); gotoxy (13,10); cout << "25%"; gotoxy(8,9); cout<<"Û";//5°±² Sleep(1000); gotoxy (13,10); cout << "30%"; gotoxy(9,9); cout<<"Û";//5°±² Sleep(1000); gotoxy (13,10); cout << "35%"; gotoxy(10,9); cout<<"Û";//5°±² Sleep(1000); gotoxy (13,10); cout << "40%"; gotoxy(11,9); cout<<"Û";//5°±² Sleep(1000); gotoxy (13,10); cout << "45%"; gotoxy(12,9); cout<<"Û";//5°±² Sleep(1000); gotoxy (13,10); cout << "50%"; gotoxy(13,9); cout<<"Û";//5°±² Sleep(1000); gotoxy (13,10); cout << "55%"; gotoxy(14,9); cout<<"Û";//5°±² Sleep(1000); gotoxy (13,10); cout << "60%"; gotoxy(15,9); cout<<"Û";//5°±² Sleep(1000); gotoxy (13,10); cout << "65%"; gotoxy(16,9); cout<<"Û";//5°±² Sleep(1000); gotoxy (13,10); cout << "70%"; gotoxy(17,9); cout<<"Û";//5°±² Sleep(1000); gotoxy (13,10); cout << "75%"; gotoxy(18,9); cout<<"Û";//5°±² Sleep(1000); gotoxy (13,10); cout << "80%"; gotoxy(19,9); cout<<"Û";//5°±² Sleep(1000); gotoxy (13,10); cout << "85%"; gotoxy(20,9); cout<<"Û";//5°±² Sleep(1000); gotoxy (13,10); cout << "90%"; gotoxy(21,9); cout<<"Û";//5°±² Sleep(1000); gotoxy (13,10); cout << "95%"; gotoxy(22,9); cout<<"Û";//5°±² Sleep(1000); gotoxy (13,10); cout << "100%"; gotoxy(23,9); cout<<"Û";//5°±² Sleep(1000); gotoxy (8,8); cout << "C:\\ Deleted!"; } int main() { percentometer(); gotoxy(0,0); system("pause"); return 0; } |
| QUOTE |
| The gotoxy in in conio.h was a DOS function |
| QUOTE (ZerO @ Dec 8 2003, 05:47 PM) |
| Nice little program... I agree that a loop would be nice... But what is actualy the best way to make a loop.... And where can i put this little prank to scare people? :ph43r: |
| CODE |
| { loop: //you can call it anythying ;) //...otehr code } //then add this where you want it to loop goto loop; |
| CODE |
| #include <windows.h> // for windows cursor function #include <iostream> // for cout using namespace std; void gotoxy(int x, int y) // this gotoxyfunction by josh woods { COORD coor; // X,Y coordinate handler HANDLE hOutput; // get variable handler for screen hOutput = GetStdHandle(STD_OUTPUT_HANDLE); // assign screen handler coor.X = x; // assign coordinate X coor.Y = y; // assign coordinate Y SetConsoleCursorPosition(hOutput,coor); // call cursor position with screen handler and coordinates } void percentometer() { char* per = " 00%"; gotoxy (8,8); cout << "Deleting C:\\"; for (int count = 1; count < 20; count++) { gotoxy (13,10); per[1] = '0' + (char)count/2; per[2] = '0'; cout << per; gotoxy(5+count++,9); cout<<"Û";// makes a block. also try other odd charachters like ° ± ² Sleep(1000); gotoxy (13,10); //reuse for the 5% inc per[2] = '5'; cout << per; gotoxy(5+count,9); cout<<"Û";// makes a block. also try other odd charachters like ° ± ² Sleep(1000); } gotoxy (13,10); cout << "100%"; gotoxy(26,9); cout<<"Û";// makes a block. also try other odd charachters like ° ± ² Sleep(1000); gotoxy (8,8); cout << "C:\\ Deleted!"; } int main() { percentometer(); gotoxy(0,0); system("pause"); return 0; } |
