Saturday, August 30th, 2008
A basical console clock written in freepascal by me, even if it’s an old language, I have to practice on it for school.
Here you got the code, I’ve added little comments but it isn’t a lot. hh = hour mm = minutes ss= seconds
(more…)
Posted in source code | No Comments »
Friday, August 29th, 2008
C programming and pascal, that’s what I’m doing for the moment, I have an exam in 5 days, man I hate it.
Just finished a clock in C: you give the time for tomorrow and he’ll count it down. But it’s basic:
#include
#include
int main(int argc, char *argv[])
{
long hh, mm,th, tm, ts;
printf(“Reveil a quelle heure(24) minutes? \t”);
scanf(“%ld”, &hh);
scanf(“%ld”, &mm);
th= hh+24; //ceci pr une journee
tm = 60 – mm;
ts=0;
while(th>=hh)
{
if(ts>0){ts-=1; sleep(1000);}
else if(tm>0){ts=60; tm–;}
else if (th>hh){ts=60; tm=60; th–;}
else if (th=hh){if(ts>0){ts–;}}
system(“cls”);
printf(“%ld : %ld : %ld”, th, tm, ts);
}
system(“PAUSE”);
return 0;
}
I’m more or less pleased but still the infinite refreshments aren’t what I wanted and sorry about the comment but in exercises I don’t use them (more…)
Posted in source code | No Comments »