annotate repper.c @ 2:d7e5ec99037f default tip

Autmatic Win32 Porting
author VilyaemKenyaz
date Thu, 28 Sep 2023 13:22:13 -0400
parents deb42211d649
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
1 // Repper helps the user pace their reps and sets
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
2
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
3 #include <stdio.h>
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
4 #include <stdlib.h>
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
5 #include <unistd.h>
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
6
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
7 int main(int argc, char* argv[]){
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
8
1
deb42211d649 Automated Vimcurial commmit
VilyaemKenyaz
parents: 0
diff changeset
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
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
10
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
11 unsigned int sets = atoi(argv[1]);
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
12 unsigned int reps = atoi(argv[2]);
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
13 unsigned int reptime = atoi(argv[3]);
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
14 unsigned int settime = atoi(argv[4]);
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
15 printf("Starting repper with %d Sets and %d Reps Rep Rest: %d Set Rest: %d \n", sets, reps, reptime, settime);
1
deb42211d649 Automated Vimcurial commmit
VilyaemKenyaz
parents: 0
diff changeset
16 puts("Waiting 3 Seconds to make sure you are ready\n");
0
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
17 sleep(3);
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
18 for ( sets > 0; sets--;){
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
19
1
deb42211d649 Automated Vimcurial commmit
VilyaemKenyaz
parents: 0
diff changeset
20 for (unsigned int newreps = reps; newreps > 0; newreps --){
0
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
21 sleep(reptime);
1
deb42211d649 Automated Vimcurial commmit
VilyaemKenyaz
parents: 0
diff changeset
22 putchar('\a');
0
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
23 printf("Rep completed, reps left in the set: %d\n", newreps);
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
24 }
1
deb42211d649 Automated Vimcurial commmit
VilyaemKenyaz
parents: 0
diff changeset
25 puts("\a\a\a");
0
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
26 printf("Set completed, sets left in the exercise: %d\n", sets);
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
27 sleep(settime);
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
28 }
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
29
1
deb42211d649 Automated Vimcurial commmit
VilyaemKenyaz
parents: 0
diff changeset
30 puts("Repper is finished");
0
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
31 exit(0);
0e9d15783f1d Finished program
VilyaemKenyaz
parents:
diff changeset
32 }