Carbuncle Generator

twitterの@_Carbuncleが可愛すぎて生きるのが辛いのでテキトウに書いてみた.


/* Carbuncle Generator */
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void)
{
int s=0, sb=0;
char str[4][4]={"ぐ", "っ", "!", "ー"};

srand(time(NULL));
while(1){
if(s==0){
printf("%s", str[s]);
sb=0;
}else if(s==1){
if(sb==0){
printf("%s", str[s]);
sb=1;
}
if(rand()%10 == 0) break;
}else if(s==2){
if(sb!=2){
printf("%s", str[s]);
sb=2;
}
if(rand()%10 == 0) break;
}else if(s==3){
if(sb==0){
printf("%s", str[s]);
sb=3;
}
if(rand()%30 == 0) break;
}
s=rand()%4;
}
return 0;
}