feat,refac: 게임 로직 내 '랜덤'을 RandUtil을 활용하여 재설정 #219

Merged
Hide_D merged 7 commits from drbg_world into devel 2022-05-18 00:56:59 +09:00
2 changed files with 7 additions and 1 deletions
Showing only changes of commit 9efe7ba171 - Show all commits
+3
View File
@@ -35,6 +35,9 @@ export class RandUtil {
if (prob === 0.5){
return this.nextBit();
}
if (prob <= 0){
return false;
}
return this.nextFloat1() < prob;
}
+4 -1
View File
@@ -42,9 +42,12 @@ class RandUtil
if ($prob >= 1) {
return true;
}
if($prob === 0.5){
if ($prob === 0.5){
return $this->nextBit();
}
if ($prob <= 0){
return false;
}
return $this->nextFloat1() < $prob;
}