質問編集履歴
1
もっと詳しくとのことなので
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,31 +1,49 @@
|
|
1
|
-
|
1
|
+
編集し直します。パズルゲーム『倉庫番』を解くソフトを作ろうと思っているのですが、
|
2
2
|
|
3
|
-
|
3
|
+
```
|
4
4
|
|
5
|
-
|
5
|
+
class t_node
|
6
6
|
|
7
|
+
{
|
8
|
+
|
9
|
+
public ulong hash_key; // ノードのハッシュ値
|
10
|
+
|
11
|
+
public ulong before_hash_key; // 前のノードのハッシュ値
|
12
|
+
|
13
|
+
public static int[] box_pos = new int[BAGGAGE_MAX]; // 箱の位置
|
14
|
+
|
15
|
+
public int box_number; // 動かした箱の番号
|
16
|
+
|
17
|
+
public int man_pos; // プレイヤーがいる位置
|
18
|
+
|
19
|
+
public int step; // 歩数
|
20
|
+
|
21
|
+
public int state; // 既に探索したノードかどうか
|
22
|
+
|
23
|
+
public int cost; // 現在位置のコスト(低いほどよい)
|
24
|
+
|
7
|
-
}
|
25
|
+
}
|
8
26
|
|
9
27
|
|
10
28
|
|
11
|
-
|
29
|
+
// 正解の手を探索
|
12
30
|
|
13
|
-
|
31
|
+
void playstep_search()
|
14
32
|
|
15
|
-
|
33
|
+
{
|
16
34
|
|
35
|
+
t_node nownode = new t_node(); // 現在の局面
|
36
|
+
|
37
|
+
t_node newnode = new t_node(); // 現在の局面から番人を一手動かしてみた局面
|
38
|
+
|
17
|
-
|
39
|
+
// 以下色々
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
}
|
18
46
|
|
19
47
|
```
|
20
48
|
|
21
|
-
と
|
49
|
+
としてnewnode.man_pos の値を変えても nownode.man_pos の値が変わらないようにしたいのですが、何か良い方法はないでしょうか?
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
Visual Community 2017
|
26
|
-
|
27
|
-
Windows10
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
本当に初心者なのでよろしくお願いします。
|