#include #include #include int random(void) { srand( (unsigned)time(NULL) ); /* 乱数の種を設定 */ int x = rand() % 6 + 1; /* 1〜6をランダムに取得 */ return x; }