changeset 0:0e9d15783f1d

Finished program
author VilyaemKenyaz
date Fri, 25 Aug 2023 13:46:12 -0400
parents
children deb42211d649
files README.md c.ksh repper repper.c
diffstat 4 files changed, 46 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README.md	Fri Aug 25 13:46:12 2023 -0400
@@ -0,0 +1,3 @@
+# Repper
+'repper' is a C program that helps you keep track of your reps and sets
+for a certain exercise, you give it the amount of sets, the wait time between the sets, the number of reps per set, and the time to wait between each set. Repper beeps accordingly.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/c.ksh	Fri Aug 25 13:46:12 2023 -0400
@@ -0,0 +1,8 @@
+#/bin/ksh
+#Compilation script
+clear
+echo "Compiling"
+rm repper
+tcc repper.c -o repper
+cp repper /usr/bin/
+./repper
Binary file repper has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/repper.c	Fri Aug 25 13:46:12 2023 -0400
@@ -0,0 +1,35 @@
+// 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, this uses the 'beep' program. \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);
+	printf("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);
+			system("beep");
+			printf("Rep completed, reps left in the set: %d\n", newreps);
+		}
+		system("beep;beep;beep");
+		printf("Set completed, sets left in the exercise: %d\n", sets);
+		sleep(settime);
+	}
+
+	printf("Repper is finished\n");
+	exit(0);
+}