diff --git a/twe/func.php b/twe/func.php index 6fb84867..d164e06e 100644 --- a/twe/func.php +++ b/twe/func.php @@ -24,6 +24,14 @@ function randF(){ return mt_rand() / mt_getrandmax(); } +/** + * $prob의 확률로 true를 반환 + * @return boolean + */ +function randBool($prob = 0.5){ + return randF() < $prob; +} + /** * 로그인한 유저의 전역 id를 받아옴 *