Skip to content

Instantly share code, notes, and snippets.

@Tritlo
Created May 14, 2012 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tritlo/2698034 to your computer and use it in GitHub Desktop.
Save Tritlo/2698034 to your computer and use it in GitHub Desktop.
Diablo III countdown
#include <stdio.h>
#include <time.h>
#ifdef __unix__
int clear()
{
system("clear");
return 0;
}
#elif defined _WIN32
int clear()
{
system("cls");
return 0;
}
#endif
int main(void)
{
int diablo_rel = 1337065260;
time_t now;
int time_left = 1;
while(time_left > 0)
{
time(&now);
time_left = iablo_rel-now;
clear();
printf("%d klst, %d mín, %d sek í Diablo III\n", time_left/3600,(time_left/60) % 60 , time_left % 60);
sleep(1);
}
clear();
printf("Diablo III er kominn út!");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment