commit fb7f3036c7d10390adcd5c16e3f0fe18ed83199d Author: Quinn <99677023+thepigeongenerator@users.noreply.github.com> Date: Wed Jun 12 20:34:45 2024 +0200 uploaded files diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..646396f --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.vscode +build +package/usr \ No newline at end of file diff --git a/package/DEBIAN/control b/package/DEBIAN/control new file mode 100644 index 0000000..3470026 --- /dev/null +++ b/package/DEBIAN/control @@ -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" diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..037df5f --- /dev/null +++ b/src/main.c @@ -0,0 +1,18 @@ +#include +#include +#include + +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; +}