A freepascal clock
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
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
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:
01 02 #include03 #include04 05 int main(int argc, char *argv[])06 {07 long hh, mm,th, tm, ts;08 09 printf("Reveil a quelle heure(24) minutes? \t");10 scanf("%ld", &hh);11 scanf("%ld", &mm);12 13 th= hh+24; //ceci pr une journee14 tm = 60 - mm;15 ts=0;16 while(th>=hh)17 {18 if(ts>0){ts-=1; sleep(1000);}19 else if(tm>0){ts=60; tm--;}20 else if (th>hh){ts=60; tm=60; th--;}21 else if (th=hh){if(ts>0){ts--;}}22 system("cls");23 printf("%ld : %ld : %ld", th, tm, ts);24 25 }26 27 system("PAUSE");28 return 0;29 }30 31 <span style="text-decoration: line-through;">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</span> <a href="http://webscriptz.be/2008/08/29/c-fpc/108#more-108" class="more-link">(More ...)</a>