facebook twitter hatena line google mixi email

将棋プログラム/as2少し自作

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
trace("tesa");
var koma = new Object();
koma.move_str = new Object();
koma.move = new Object();
koma.move_str.fu = '[{"x":1,"y":1}]';
koma.move_str.kyou = '[{"x":1,"y":1,"l":1}]';
koma.move_str.kei = '[{"x":1,"y":2},{"x":3,"y":2}]';
koma.move_str.gin = '[{"x":1,"y":1},{"x":2,"y":1},{"x":3,"y":1},{"x":1,"y":-1},{"x":3,"y":-1}]';
koma.move_str.kin = '[{"x":1,"y":1},{"x":2,"y":1},{"x":3,"y":1},{"x":1,"y":0},{"x":3,"y":-1},{"x":2,"y":-1}]';
koma.move_str.kaku = '[{"x":1,"y":1,"l":1},{"x":3,"y":1,"l":1},{"x":1,"y":-1,"l":1},{"x":3,"y":-1,"l":1}]';
koma.move_str.hi = '{"x":2,"y":1,"l":1},{"x":1,"y":0,"l":1},{"x":3,"y":-1,"l":1},{"x":2,"y":-1,"l":1}]';
koma.move_str.ou = '[{"x":1,"y":1},{"x":2,"y":1},{"x":3,"y":1},{"x":1,"y":0},{"x":3,"y":-1},{"x":1,"y":-1},{"x":2,"y":-1},{"x":3,"y":-1}]';
koma.move_str.tokin = koma.move_str.kin;
koma.move_str.nari_kyou = koma.move_str.kin;
koma.move_str.nari_kei = koma.move_str.kin;
koma.move_str.nari_gin = koma.move_str.kin;
koma.move_str.uma = '[{"x":1,"y":1,"l":1},{"x":2,"y":1},{"x":3,"y":1,"l":1},{"x":1,"y":0},{"x":3,"y":-1},{"x":1,"y":-1,"l":1},{"x":2,"y":-1},{"x":3,"y":-1,"l":1}]';
koma.move_str.ryuu = '[{"x":1,"y":1},{"x":2,"y":1,"l":1},{"x":3,"y":1},{"x":1,"y":0,"l":1},{"x":3,"y":-1,"l":1},{"x":1,"y":-1},{"x":2,"y":-1,"l":1},{"x":3,"y":-1}]';
trace(koma.move_str.ryuu);
for (var i in koma.move_str) {
  trace(koma.move_str[i]);
  koma.move[i] = JSON.parse(koma.move_str[i]);
}
//    var o:Object = JSON.parse(jsonStr);
//    var s:String = JSON.stringify(obj);