Advertisement
Guest User

Simple Game Console in C

a guest
Oct 30th, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<windows.h>
  3. int main()
  4. {
  5.     int TIMES = 5;
  6.     for(int i=0; i<TIMES; i++)
  7.     {
  8.         printf("%12s", i<4
  9.                ?"Lives left: ":"Life left: ");
  10.         for(int j=0; j<TIMES-i; j++)
  11.             printf("%c", 3);
  12.         Sleep(1000);
  13.         system("cls");
  14.         Sleep(100);
  15.     }
  16.     for(int i=0; i<3; i++)
  17.     {
  18.         char s[] = "..:: Game over ::..";
  19.         printf("%*s\n",40+strlen(s)/2, s);
  20.         Sleep(500);
  21.         system("cls");
  22.         Sleep(500);
  23.  
  24.     }
  25.  
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement