質問編集履歴
1
mapのプログラムを書いた
test
CHANGED
File without changes
|
test
CHANGED
@@ -53,3 +53,45 @@
|
|
53
53
|
プログラムの順番:
|
54
54
|
|
55
55
|
一部の変数の定義 => 配列mapに数を入れる => abcdefのfor文
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
追記:map作るところ
|
60
|
+
|
61
|
+
```js
|
62
|
+
|
63
|
+
for (var a = 0; a < i; a++) {
|
64
|
+
|
65
|
+
map[a] = []
|
66
|
+
|
67
|
+
for (var b = 0; b < i; b++) {
|
68
|
+
|
69
|
+
map[a][b] = []
|
70
|
+
|
71
|
+
for (var c = 0; c < i; c++) {
|
72
|
+
|
73
|
+
var OR = Math.floor(Math.random() * (Kosu));
|
74
|
+
|
75
|
+
if(OR === 1){
|
76
|
+
|
77
|
+
var Gen = Math.floor(Math.random()*(4))
|
78
|
+
|
79
|
+
}else{
|
80
|
+
|
81
|
+
Gen =5;
|
82
|
+
|
83
|
+
}
|
84
|
+
|
85
|
+
map[a][b][c] = Gen;
|
86
|
+
|
87
|
+
Gen = 5
|
88
|
+
|
89
|
+
}
|
90
|
+
|
91
|
+
}
|
92
|
+
|
93
|
+
}
|
94
|
+
|
95
|
+
```
|
96
|
+
|
97
|
+
Kosu は 2です。
|