()
| 1 | // true 代表换之后赢了 |
| 2 | // false 代表换了之后输了 |
| 3 | function threeDoors() { |
| 4 | const doors = [0, 0, 1]; |
| 5 | const random = Math.random() * doors.length; |
| 6 | const pos = Math.floor(random); |
| 7 | if (doors[pos]) return false; |
| 8 | console.count(pos); |
| 9 | return true; |
| 10 | } |
| 11 | |
| 12 | const times = 1000000; |
| 13 | for(let i = 0; i < times; i++) { |
no outgoing calls
no test coverage detected