回答編集履歴
2
追記
answer
CHANGED
@@ -20,4 +20,30 @@
|
|
20
20
|
document.querySelector('textarea').value+=images[getIndex(number)];
|
21
21
|
}
|
22
22
|
</script>
|
23
|
-
```
|
23
|
+
```
|
24
|
+
|
25
|
+
表にするとこうです
|
26
|
+
|
27
|
+
|number|Math.abs(number)|Math.abs(number)%((len-1)*2)|idx>=len|(len-1)*2-idx;|
|
28
|
+
|--:|--:|--:|--:|--:|
|
29
|
+
|-10|10|2|||
|
30
|
+
|-9|9|1|||
|
31
|
+
|-8|8|0|||
|
32
|
+
|-7|7|7|true|1|
|
33
|
+
|-6|6|6|true|2|
|
34
|
+
|-5|5|5|true|3|
|
35
|
+
|-4|4|4|||
|
36
|
+
|-3|3|3|||
|
37
|
+
|-2|2|2|||
|
38
|
+
|-1|1|1|||
|
39
|
+
|0|0|0|||
|
40
|
+
|1|1|1|||
|
41
|
+
|2|2|2|||
|
42
|
+
|3|3|3|||
|
43
|
+
|4|4|4|||
|
44
|
+
|5|5|5|true|3|
|
45
|
+
|6|6|6|true|2|
|
46
|
+
|7|7|7|true|1|
|
47
|
+
|8|8|0|||
|
48
|
+
|9|9|1|||
|
49
|
+
|10|1|2|||
|
1
調整
answer
CHANGED
@@ -1,5 +1,23 @@
|
|
1
|
-
命題が合理的ではありません
|
1
|
+
**ボールドテキスト**命題が合理的ではありません
|
2
2
|
1→2→3→4→5→4→3・・・となるなら
|
3
3
|
遡る方も
|
4
4
|
1←5←4←3ではなく
|
5
|
-
1←2←3←4←5←4←3となるべきです
|
5
|
+
1←2←3←4←5←4←3となるべきです
|
6
|
+
|
7
|
+
# sample
|
8
|
+
こんな感じでどうでしょう?
|
9
|
+
```javascript
|
10
|
+
<textarea cols=40 rows=10></textarea>
|
11
|
+
<script>
|
12
|
+
const images = ["img01","img02","img03","img04","img05"];
|
13
|
+
const len=images.length;
|
14
|
+
const getIndex=number=>{
|
15
|
+
let idx=Math.abs(number)%((len-1)*2);
|
16
|
+
if(idx>=len) idx=(len-1)*2-idx;
|
17
|
+
return idx;
|
18
|
+
}
|
19
|
+
for(let number=-30;number<30;number++){//numberを適当な範囲で変更
|
20
|
+
document.querySelector('textarea').value+=images[getIndex(number)];
|
21
|
+
}
|
22
|
+
</script>
|
23
|
+
```
|