Skip to content

Instantly share code, notes, and snippets.

@ariedro
Created December 8, 2018 23:04
Show Gist options
  • Save ariedro/7afa4c5492ec194e004599e97920d766 to your computer and use it in GitHub Desktop.
Save ariedro/7afa4c5492ec194e004599e97920d766 to your computer and use it in GitHub Desktop.
Color randomizer by word for IRC messages
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(int argc, char* argv[]) {
srand(time(NULL));
int i = 0;
printf("/eval ");
while (argv[1][i] != '\0')
if (argv[1][i] == ' ' || i == 0)
printf("${\\x03}%d%c", rand() % 14 + 2,argv[1][i++]);
else
printf("%c",argv[1][i++]);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment