uploaded files

This commit is contained in:
Quinn
2024-06-12 20:34:45 +02:00
commit fb7f3036c7
3 changed files with 25 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
.vscode
build
package/usr

4
package/DEBIAN/control Normal file
View File

@@ -0,0 +1,4 @@
Package: coinflip
Architecture: all
Priority: optional
Description: adds a coinflip command which has a 50% chance of printing "heads" and 50% chance of printing "tails"

18
src/main.c Normal file
View File

@@ -0,0 +1,18 @@
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
int main(void) {
srand(time(NULL)); // set the random seed to the system time
char* result = NULL;
if (rand() & (~1) != 0) {
result = "heads";
}
else {
result = "tails";
}
printf("%s\n", result);
return 0;
}