srand设置种子,rand()%2获得0 或者1; rand()%3获得0 1 2... srand(GetTickCount()); current_curtain_detector =rand()%2;