質問編集履歴
1
もっと詳しくとのことなので
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,16 +1,25 @@
|
|
1
|
-
```C#
|
2
|
-
class test{
|
3
|
-
public int a;
|
4
|
-
}
|
5
|
-
|
6
|
-
|
1
|
+
編集し直します。パズルゲーム『倉庫番』を解くソフトを作ろうと思っているのですが、
|
7
|
-
test B = new test();
|
8
|
-
A.a = 10;
|
9
|
-
B.a = 20;
|
10
2
|
```
|
3
|
+
class t_node
|
4
|
+
{
|
5
|
+
public ulong hash_key; // ノードのハッシュ値
|
6
|
+
public ulong before_hash_key; // 前のノードのハッシュ値
|
7
|
+
public static int[] box_pos = new int[BAGGAGE_MAX]; // 箱の位置
|
8
|
+
public int box_number; // 動かした箱の番号
|
9
|
+
public int man_pos; // プレイヤーがいる位置
|
11
|
-
|
10
|
+
public int step; // 歩数
|
11
|
+
public int state; // 既に探索したノードかどうか
|
12
|
+
public int cost; // 現在位置のコスト(低いほどよい)
|
13
|
+
}
|
12
14
|
|
15
|
+
// 正解の手を探索
|
13
|
-
|
16
|
+
void playstep_search()
|
17
|
+
{
|
18
|
+
t_node nownode = new t_node(); // 現在の局面
|
19
|
+
t_node newnode = new t_node(); // 現在の局面から番人を一手動かしてみた局面
|
14
|
-
|
20
|
+
// 以下色々
|
15
21
|
|
22
|
+
|
23
|
+
}
|
24
|
+
```
|
16
|
-
|
25
|
+
としてnewnode.man_pos の値を変えても nownode.man_pos の値が変わらないようにしたいのですが、何か良い方法はないでしょうか?
|