0
|
1 // Repper helps the user pace their reps and sets
|
|
2
|
|
3 #include <stdio.h>
|
|
4 #include <stdlib.h>
|
|
5 #include <unistd.h>
|
|
6
|
|
7 int main(int argc, char* argv[]){
|
|
8
|
1
|
9 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);}
|
0
|
10
|
|
11 unsigned int sets = atoi(argv[1]);
|
|
12 unsigned int reps = atoi(argv[2]);
|
|
13 unsigned int reptime = atoi(argv[3]);
|
|
14 unsigned int settime = atoi(argv[4]);
|
|
15 printf("Starting repper with %d Sets and %d Reps Rep Rest: %d Set Rest: %d \n", sets, reps, reptime, settime);
|
1
|
16 puts("Waiting 3 Seconds to make sure you are ready\n");
|
0
|
17 sleep(3);
|
|
18 for ( sets > 0; sets--;){
|
|
19
|
1
|
20 for (unsigned int newreps = reps; newreps > 0; newreps --){
|
0
|
21 sleep(reptime);
|
1
|
22 putchar('\a');
|
0
|
23 printf("Rep completed, reps left in the set: %d\n", newreps);
|
|
24 }
|
1
|
25 puts("\a\a\a");
|
0
|
26 printf("Set completed, sets left in the exercise: %d\n", sets);
|
|
27 sleep(settime);
|
|
28 }
|
|
29
|
1
|
30 puts("Repper is finished");
|
0
|
31 exit(0);
|
|
32 }
|