Created
June 5, 2018 14:59
-
-
Save ToshihitoKon/8c49d540796a45845761d15a7aad4e57 to your computer and use it in GitHub Desktop.
bemybaby...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main() | |
{ | |
int seq[4]; | |
char bmbb[4][3] = {"BE","MY","BA","BY"}; | |
for(int i=0;;i++){ | |
seq[i%4] = random() % 4; | |
printf("%s", bmbb[seq[i%4]]); | |
fflush(stdout); | |
switch(seq[i%4]){ | |
case 0: system("paplay be.wav 2>/dev/null"); break; | |
case 1: system("paplay my.wav 2>/dev/null"); break; | |
case 2: system("paplay ba.wav 2>/dev/null"); break; | |
case 3: system("paplay by.wav 2>/dev/null"); break; | |
} | |
if( seq[(i-3)%4]==0 && | |
seq[(i-2)%4]==1 && | |
seq[(i-1)%4]==2 && | |
seq[i%4]==3 ){ | |
system("paplay ah.wav 2>/dev/null"); | |
printf("アッフゥン\n"); | |
return 0; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment