回答編集履歴
1
ランダム数値が、7が最高値になってしまっていたので修正
answer
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
```javascript
|
2
2
|
const max = 7;
|
3
|
-
const n = Math.floor( Math.random() * max ) + 1;
|
3
|
+
const n = Math.floor( Math.random() * (max - 1) ) + 1;
|
4
4
|
console.log(max - n);
|
5
5
|
```
|