Mercurial Hosting > repper
view repper.c @ 2:d7e5ec99037f default tip
Autmatic Win32 Porting
author | VilyaemKenyaz |
---|---|
date | Thu, 28 Sep 2023 13:22:13 -0400 |
parents | deb42211d649 |
children |
line wrap: on
line source
// Repper helps the user pace their reps and sets #include <stdio.h> #include <stdlib.h> #include <unistd.h> int main(int argc, char* argv[]){ if (argc == 1){puts("Repper by Vilyaem peepsoftgames.github.io thekenyaz@yandex.com\n Usage: \n repper (unsigned int sets) (unsigned int reps) (unsigned int reptime) (unsignd int settime)\n 3 Beeps is a set completion, 1 beep is rep completion.\n");exit(1);} unsigned int sets = atoi(argv[1]); unsigned int reps = atoi(argv[2]); unsigned int reptime = atoi(argv[3]); unsigned int settime = atoi(argv[4]); printf("Starting repper with %d Sets and %d Reps Rep Rest: %d Set Rest: %d \n", sets, reps, reptime, settime); puts("Waiting 3 Seconds to make sure you are ready\n"); sleep(3); for ( sets > 0; sets--;){ for (unsigned int newreps = reps; newreps > 0; newreps --){ sleep(reptime); putchar('\a'); printf("Rep completed, reps left in the set: %d\n", newreps); } puts("\a\a\a"); printf("Set completed, sets left in the exercise: %d\n", sets); sleep(settime); } puts("Repper is finished"); exit(0); }