回答編集履歴

1

ランダム数値が、7が最高値になってしまっていたので修正

2020/06/23 02:56

投稿

miyabi_pudding
miyabi_pudding

スコア9528

test CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  const max = 7;
4
4
 
5
- const n = Math.floor( Math.random() * max ) + 1;
5
+ const n = Math.floor( Math.random() * (max - 1) ) + 1;
6
6
 
7
7
  console.log(max - n);
8
8