commit cdfa6de29413d54534be4a872172f93440d26863 Author: gman Date: Thu Jun 29 20:18:26 2023 -0400 First Commit diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ca52fce --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +uwu: uwu.c + gcc -o uwu uwu.c diff --git a/README.md b/README.md new file mode 100644 index 0000000..8b21161 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# UWUIFYER + +this is just a dumb c program to uwuifyer any text or file you feed it. + +# useage + +just run +``` +./uwuifyer -h +``` +and figure it out from there diff --git a/uwu.c b/uwu.c new file mode 100644 index 0000000..0b97f57 --- /dev/null +++ b/uwu.c @@ -0,0 +1,106 @@ +#include +#include +#include +#include + +char file[256]; +char *words; +char lastc; +int s = 0; + +void args(int argc, char *argv[]){ + while ((++argv)[0]){ + if (argv[0][0] == '-'){ + switch (argv[0][1]){ + default: + printf("Unkown option -%c uwu -h for help.\n\n",argv[0][1]); + break; + case 'f': + case 'F': + strcpy(file, argv[1]); + break; + case 'i': + case 'I': + words = (char *) malloc(strlen(argv[1])); + strcpy(words, argv[1]); + break; + case 'h': + case 'H': + printf("-h for this -i for input -f for file -s for stutter\n"); + break; +// printf("%s",argv[1]); + case 's': + case 'S': + s=1; + break; + } + } + } +} + +char uwu(char c){ + switch(c){ + default: + break; + case 'l': + case 'r': + putchar('w'); + return(c); + case 'L': + case 'R': + putchar('W'); + return(c); + } + if ((lastc =='n') && (c=='a'||c=='e'||c=='i'||c=='o'||c=='u')) // th> + { + putchar('y'); + if (c!='a') + { + putchar('a'); + } + putchar(c); + return(c); + } + if ((lastc=='a')&&(c == ' ' || c == '\n')) + { + putchar('~'); + } + if(lastc == ' ' && (rand() % 7) == 1 && c != ' ' && s == 1) + { + putchar(c); + putchar('-'); + } + putchar(c); +} + +void uwuify(){ + time_t t; + srand((unsigned) time (&t)); + if (file[0] =='\0' && words != NULL){ +// printf("yeah it work\n"); +// printf("%s\n",words); + for (int i = 0; i < strlen(words); i++) { + lastc = uwu(words[i]); + } + } else if (file[0] != '\0'){ + FILE *fp; + int c; +// printf("yeah we be reading %s\n",file); + fp = fopen(file,"r"); + if (fp == NULL) { + printf("Error opening file.\n"); + return; + } + while ((c = fgetc(fp)) != EOF) { + lastc = uwu(c); + } + fclose(fp); + } + return; +} + +int main(int argc, char *argv[]){ + args(argc,argv); +// printf("%s\n",file); + uwuify(); +}