teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

もっと詳しくとのことなので

2018/04/28 07:53

投稿

MZ-SOFT
MZ-SOFT

スコア11

title CHANGED
File without changes
body CHANGED
@@ -1,16 +1,25 @@
1
- ```C#
2
- class test{
3
- public int a;
4
- }
5
-
6
- test A = new test();
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
- とするとA.aも20になってしまうのですが、別別にするにはどうすればよいのでしょうか?
10
+ public int step; // 歩数
11
+ public int state; // 既に探索したノードかどうか
12
+ public int cost; // 現在位置のコスト(低いほどよい)
13
+ }
12
14
 
15
+ // 正解の手を探索
13
- Visual Community 2017
16
+ void playstep_search()
17
+ {
18
+ t_node nownode = new t_node(); // 現在の局面
19
+ t_node newnode = new t_node(); // 現在の局面から番人を一手動かしてみた局面
14
- Windows10
20
+ // 以下色々
15
21
 
22
+
23
+ }
24
+ ```
16
- 本当に初心者なくお願しま
25
+ としてnewnode.man_pos 値を変えても nownode.man_pos の値が変わらないうにのでが、何か良い方法はないでしょうか?