Advertisement
Guest User

DevQuiz PAC-MAN

a guest
Aug 23rd, 2010
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 31.99 KB | None | 0 0
  1. import java.io.BufferedReader;
  2. import java.io.File;
  3. import java.io.FileNotFoundException;
  4. import java.io.FileReader;
  5. import java.io.IOException;
  6. import java.util.ArrayList;
  7. import java.util.Date;
  8.  
  9.  
  10. public class Pacman7 {
  11.  
  12.     // レベル1完全探索 レベル2LRJ専用最適化 レベル3未定(現状はレベル2にVH当たり判定を付けただけ)
  13.     final static int level = 3;
  14.     // 足切りパラメータ
  15.     final static int ashikiri = 5;      // 1つの節に許される枝の数
  16.     final static int cutoffset = 5;     // このtまでは全枝を探索する
  17.     final static int cutlength = 50;        // 節と節の間の長さ
  18.     final static int cutscore = 500;        // tの最大値の制限
  19.  
  20. //  // レベル1参考設定
  21. //  final static int level = 1;
  22. //  final static int ashikiri = 0;
  23. //  final static int cutoffset = 1;
  24. //  final static int cutlength = 50;
  25. //  final static int cutscore = 50;
  26. //  // レベル2参考設定
  27. //  final static int level = 2;
  28. //  final static int ashikiri = 5;
  29. //  final static int cutoffset = 5;
  30. //  final static int cutlength = 50;
  31. //  final static int cutscore = 250;
  32. //  // レベル3参考設定
  33. //  final static int level = 3;
  34. //  final static int ashikiri = 5;
  35. //  final static int cutoffset = 5;
  36. //  final static int cutlength = 50;
  37. //  final static int cutscore = 500;
  38.  
  39.     // 計算再開用 足切りパラメータや探索ロジックを変えたら無意味
  40.     final static int skipsteps = 0;
  41.  
  42.     static int deftime = 0, defwidth = 0, defheight = 0;
  43.     static int tsize = 0, xsize = 0, ysize = 0;
  44.  
  45.     final static int[][] move = { {0,0}, {0,1}, {-1,0}, {0,-1}, {1,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0} };
  46.     final static int[] bits = {0, 1, 2, 4, 8, 16};
  47.     final static int[] bitsoff = {0, 30, 29, 27, 23, 15};
  48.     final static int cutheight = (cutscore % cutlength) > 0 ? (cutscore / cutlength + 1) * cutlength : cutscore;
  49.    
  50.     static char[][] tile = null;
  51.    
  52.     static byte[][] theory = null;
  53.     static byte[][][][] atheory = null;
  54.     static byte[][][][][] btheory = null;
  55.     static byte[][][] vtheory = null;
  56.     static byte[][][] ltheory = null;
  57.     static byte[][][] rtheory = null;
  58.    
  59.     static byte[][] branch = null;
  60.    
  61.     static int[][] amove = null;
  62.     static int[][] atest = null;
  63.     static int[][][] vmove = null;
  64.     static int[][][] hmove = null;
  65.     static int[][][] lmove = null;
  66.     static int[][][] rmove = null;
  67.     static int[][][] jmove = null;
  68.     static int vcount = 0, hcount = 0, lcount = 0, rcount = 0, jcount = 0;
  69.  
  70.     static int[][] dcountxy = null;
  71.     static int[] dcountx = null, dcounty = null;
  72.     static int dcount = 0;
  73.  
  74.     /**
  75.      * @param args
  76.      */
  77.     public static void main(String[] args) {
  78.  
  79.         long starttime = System.currentTimeMillis();
  80.        
  81.         doPuzzle();
  82.  
  83.         long endtime = System.currentTimeMillis();
  84.         System.out.println("" + (endtime - starttime) + "ms");
  85.        
  86.     }
  87.  
  88.     private static void doPuzzle() {
  89.  
  90.         // 問題データのファイル名 末尾に余分な改行とかがあるとヤバい
  91.         String file_name = "pacman.txt";
  92.        
  93.         // ファイル読み込み
  94.         ArrayList<String> strbuf = new ArrayList<String>();
  95.         String line = null;
  96.         try {
  97.             File file = new File(file_name);
  98.             BufferedReader reader = new BufferedReader(new FileReader(file));
  99.  
  100.             int pos = 0;
  101.             line = reader.readLine();
  102.             deftime = Integer.parseInt(line);
  103.             line = reader.readLine();
  104.             pos = line.indexOf(' ');
  105.             defwidth = Integer.parseInt(line.substring(0, pos));
  106.             defheight = Integer.parseInt(line.substring(pos + 1));
  107.  
  108.             int len = 0;
  109.             while ((line = reader.readLine())!= null) {
  110.                 strbuf.add(line);
  111.                 len = line.length();
  112.                 xsize = (xsize > len) ? xsize : len;
  113.             }
  114.             ysize = strbuf.size();
  115.             reader.close();
  116.         } catch (FileNotFoundException e) {
  117.             e.printStackTrace();
  118.             return;
  119.         } catch (IOException e) {
  120.             e.printStackTrace();
  121.             return;
  122.         }
  123.         tsize = cutheight + 1;
  124.        
  125.         System.out.println("" + deftime + " " + defwidth + " " + defheight);
  126.         System.out.println("" + cutheight + " " + xsize + " " + ysize);
  127.    
  128.         tile = new char[xsize][ysize];
  129.        
  130.         for (int y = 0; y < ysize; y++) {
  131.             line = strbuf.get(y);
  132.             for (int x = 0; x < line.length(); x++) {
  133.                 tile[x][y] = line.charAt(x);
  134.             }
  135.         }
  136.        
  137.         strbuf = null;
  138.  
  139.         // マップの解析
  140.         theory = new byte[xsize][ysize];
  141.         atheory = new byte[tsize][6][xsize][ysize];
  142.         btheory = new byte[cutlength + 1][6][xsize][ysize][cutlength + 1];
  143.         vtheory = new byte[6][xsize][ysize];
  144.         ltheory = new byte[6][xsize][ysize];
  145.         rtheory = new byte[6][xsize][ysize];
  146.        
  147.         branch = new byte[xsize][ysize];
  148.        
  149.         amove = new int[tsize][10];
  150.         atest = new int[tsize][6];
  151.         vmove = new int[6][tsize][4];
  152.         hmove = new int[6][tsize][4];
  153.         lmove = new int[6][tsize][4];
  154.         rmove = new int[6][tsize][4];
  155.         jmove = new int[6][tsize][4];
  156.  
  157.         dcountxy = new int[xsize][ysize];
  158.         dcountx = new int[xsize];
  159.         dcounty = new int[ysize];
  160.        
  161.         for (int y = 1; y < ysize - 1; y++) {
  162.             for (int x = 1; x < xsize - 1; x++) {
  163.                 if (tile[x][y] != '#') {
  164.                     // 行き先は何方向?
  165.                     if (tile[x][y + 1] != '#') branch[x][y]++;
  166.                     if (tile[x - 1][y] != '#') branch[x][y]++;
  167.                     if (tile[x][y - 1] != '#') branch[x][y]++;
  168.                     if (tile[x + 1][y] != '#') branch[x][y]++;
  169.  
  170.                     // 敵の基本方針、下左上右
  171.                     if (tile[x][y + 1] != '#') theory[x][y] = 1;
  172.                     else if (tile[x - 1][y] != '#') theory[x][y] = 2;
  173.                     else if (tile[x][y - 1] != '#') theory[x][y] = 3;
  174.                     else if (tile[x + 1][y] != '#') theory[x][y] = 4;
  175.  
  176.                     // @の行動範囲を絞る
  177.                     if (tile[x][y + 1] != '#') {
  178.                         atheory[0][0][x][y] = (byte)(atheory[0][0][x][y] | 1);
  179.                         atheory[0][1][x][y] = (byte)(atheory[0][1][x][y] | 1);
  180.                         atheory[0][2][x][y] = (byte)(atheory[0][2][x][y] | 1);
  181.                         atheory[0][4][x][y] = (byte)(atheory[0][4][x][y] | 1);
  182.                         if ((level == 1) || (branch[x][y] == 1)) atheory[0][3][x][y] = (byte)(atheory[0][3][x][y] | 1);
  183.                         if ((level == 1) || (branch[x][y+1]> 2)) atheory[0][5][x][y] = (byte)(atheory[0][5][x][y] | 1);
  184.                     }
  185.                     if (tile[x - 1][y] != '#') {
  186.                         atheory[0][0][x][y] = (byte)(atheory[0][0][x][y] | 2);
  187.                         atheory[0][1][x][y] = (byte)(atheory[0][1][x][y] | 2);
  188.                         atheory[0][2][x][y] = (byte)(atheory[0][2][x][y] | 2);
  189.                         atheory[0][3][x][y] = (byte)(atheory[0][3][x][y] | 2);
  190.                         if ((level == 1) || (branch[x][y] == 1)) atheory[0][4][x][y] = (byte)(atheory[0][4][x][y] | 2);
  191.                         if ((level == 1) || (branch[x-1][y]> 2)) atheory[0][5][x][y] = (byte)(atheory[0][5][x][y] | 2);
  192.                     }
  193.                     if (tile[x][y - 1] != '#') {
  194.                         atheory[0][0][x][y] = (byte)(atheory[0][0][x][y] | 4);
  195.                         atheory[0][2][x][y] = (byte)(atheory[0][2][x][y] | 4);
  196.                         atheory[0][3][x][y] = (byte)(atheory[0][3][x][y] | 4);
  197.                         atheory[0][4][x][y] = (byte)(atheory[0][4][x][y] | 4);
  198.                         if ((level == 1) || (branch[x][y] == 1)) atheory[0][1][x][y] = (byte)(atheory[0][1][x][y] | 4);
  199.                         if ((level == 1) || (branch[x][y-1]> 2)) atheory[0][5][x][y] = (byte)(atheory[0][5][x][y] | 4);
  200.                     }
  201.                     if (tile[x + 1][y] != '#') {
  202.                         atheory[0][0][x][y] = (byte)(atheory[0][0][x][y] | 8);
  203.                         atheory[0][1][x][y] = (byte)(atheory[0][1][x][y] | 8);
  204.                         atheory[0][3][x][y] = (byte)(atheory[0][3][x][y] | 8);
  205.                         atheory[0][4][x][y] = (byte)(atheory[0][4][x][y] | 8);
  206.                         if ((level == 1) || (branch[x][y] == 1)) atheory[0][2][x][y] = (byte)(atheory[0][2][x][y] | 8);
  207.                         if ((level == 1) || (branch[x+1][y]> 2)) atheory[0][5][x][y] = (byte)(atheory[0][5][x][y] | 8);
  208.                     }
  209.                     if ((level == 1)){
  210.                         atheory[0][0][x][y] = (byte)(atheory[0][0][x][y] | 16);
  211.                         atheory[0][1][x][y] = (byte)(atheory[0][1][x][y] | 16);
  212.                         atheory[0][2][x][y] = (byte)(atheory[0][2][x][y] | 16);
  213.                         atheory[0][3][x][y] = (byte)(atheory[0][3][x][y] | 16);
  214.                         atheory[0][4][x][y] = (byte)(atheory[0][4][x][y] | 16);
  215.                         atheory[0][5][x][y] = (byte)(atheory[0][5][x][y] | 16);
  216.                     }
  217.  
  218.                     // 敵の行動範囲を絞る
  219.                     switch (branch[x][y]) {
  220.                     case 1:
  221.                         if (tile[x][y + 1] != '#') {
  222.                             vtheory[3][x][y] = 1;
  223.                             ltheory[3][x][y] = 1;
  224.                             rtheory[3][x][y] = 1;
  225.                         } else if (tile[x - 1][y] != '#') {
  226.                             vtheory[4][x][y] = 2;
  227.                             ltheory[4][x][y] = 2;
  228.                             rtheory[4][x][y] = 2;
  229.                         } else  if (tile[x][y - 1] != '#') {
  230.                             vtheory[1][x][y] = 3;
  231.                             ltheory[1][x][y] = 3;
  232.                             rtheory[1][x][y] = 3;
  233.                         } else  if (tile[x + 1][y] != '#') {
  234.                             vtheory[2][x][y] = 4;
  235.                             ltheory[2][x][y] = 4;
  236.                             rtheory[2][x][y] = 4;
  237.                         }
  238.                         break;
  239.                     case 2:
  240.                         if (tile[x][y + 1] != '#') {
  241.                             vtheory[1][x][y] = 1;
  242.                             vtheory[2][x][y] = 1;
  243.                             vtheory[4][x][y] = 1;
  244.                             ltheory[1][x][y] = 1;
  245.                             ltheory[2][x][y] = 1;
  246.                             ltheory[4][x][y] = 1;
  247.                             rtheory[1][x][y] = 1;
  248.                             rtheory[2][x][y] = 1;
  249.                             rtheory[4][x][y] = 1;
  250.                         }
  251.                         if (tile[x - 1][y] != '#') {
  252.                             vtheory[1][x][y] = 2;
  253.                             vtheory[2][x][y] = 2;
  254.                             vtheory[3][x][y] = 2;
  255.                             ltheory[1][x][y] = 2;
  256.                             ltheory[2][x][y] = 2;
  257.                             ltheory[3][x][y] = 2;
  258.                             rtheory[1][x][y] = 2;
  259.                             rtheory[2][x][y] = 2;
  260.                             rtheory[3][x][y] = 2;
  261.                         }
  262.                         if (tile[x][y - 1] != '#') {
  263.                             vtheory[2][x][y] = 3;
  264.                             vtheory[3][x][y] = 3;
  265.                             vtheory[4][x][y] = 3;
  266.                             ltheory[2][x][y] = 3;
  267.                             ltheory[3][x][y] = 3;
  268.                             ltheory[4][x][y] = 3;
  269.                             rtheory[2][x][y] = 3;
  270.                             rtheory[3][x][y] = 3;
  271.                             rtheory[4][x][y] = 3;
  272.                         }
  273.                         if (tile[x + 1][y] != '#') {
  274.                             vtheory[1][x][y] = 4;
  275.                             vtheory[3][x][y] = 4;
  276.                             vtheory[4][x][y] = 4;
  277.                             ltheory[1][x][y] = 4;
  278.                             ltheory[3][x][y] = 4;
  279.                             ltheory[4][x][y] = 4;
  280.                             rtheory[1][x][y] = 4;
  281.                             rtheory[3][x][y] = 4;
  282.                             rtheory[4][x][y] = 4;
  283.                         }
  284.                         break;
  285.                     case 3:
  286.                         if (tile[x][y + 1] == '#') {
  287.                             vtheory[1][x][y] = 2 + 16 + 32 + 64;
  288.                             vtheory[2][x][y] = 2 + 16 + 32 + 64;
  289.                             vtheory[4][x][y] = 2 + 16 + 32 + 64;
  290.                             ltheory[1][x][y] = 4;
  291.                             ltheory[2][x][y] = 2;
  292.                             ltheory[4][x][y] = 3;
  293.                             rtheory[1][x][y] = 2;
  294.                             rtheory[2][x][y] = 3;
  295.                             rtheory[4][x][y] = 4;
  296.                         } else if (tile[x - 1][y] == '#') {
  297.                             vtheory[1][x][y] = 1 + 8 + 32 + 64;
  298.                             vtheory[2][x][y] = 1 + 8 + 32 + 64;
  299.                             vtheory[3][x][y] = 1 + 8 + 32 + 64;
  300.                             ltheory[1][x][y] = 4;
  301.                             ltheory[2][x][y] = 1;
  302.                             ltheory[3][x][y] = 3;
  303.                             rtheory[1][x][y] = 1;
  304.                             rtheory[2][x][y] = 3;
  305.                             rtheory[3][x][y] = 4;
  306.                         } else  if (tile[x][y - 1] == '#') {
  307.                             vtheory[2][x][y] = 1 + 8 + 16 + 64;
  308.                             vtheory[3][x][y] = 1 + 8 + 16 + 64;
  309.                             vtheory[4][x][y] = 1 + 8 + 16 + 64;
  310.                             ltheory[2][x][y] = 1;
  311.                             ltheory[3][x][y] = 2;
  312.                             ltheory[4][x][y] = 4;
  313.                             rtheory[2][x][y] = 2;
  314.                             rtheory[3][x][y] = 4;
  315.                             rtheory[4][x][y] = 1;
  316.                         } else  if (tile[x + 1][y] == '#') {
  317.                             vtheory[1][x][y] = 1 + 8 + 16 + 32;
  318.                             vtheory[3][x][y] = 1 + 8 + 16 + 32;
  319.                             vtheory[4][x][y] = 1 + 8 + 16 + 32;
  320.                             ltheory[1][x][y] = 1;
  321.                             ltheory[3][x][y] = 2;
  322.                             ltheory[4][x][y] = 3;
  323.                             rtheory[1][x][y] = 2;
  324.                             rtheory[3][x][y] = 3;
  325.                             rtheory[4][x][y] = 1;
  326.                         }
  327.                         break;
  328.                     case 4:
  329.                         vtheory[1][x][y] = 1 + 8 + 16 + 32 + 64;
  330.                         vtheory[2][x][y] = 1 + 8 + 16 + 32 + 64;
  331.                         vtheory[3][x][y] = 1 + 8 + 16 + 32 + 64;
  332.                         vtheory[4][x][y] = 1 + 8 + 16 + 32 + 64;
  333.                         ltheory[1][x][y] = 4;
  334.                         ltheory[2][x][y] = 1;
  335.                         ltheory[3][x][y] = 2;
  336.                         ltheory[4][x][y] = 3;
  337.                         rtheory[1][x][y] = 2;
  338.                         rtheory[2][x][y] = 3;
  339.                         rtheory[3][x][y] = 4;
  340.                         rtheory[4][x][y] = 1;
  341.                         break;
  342.                     }
  343.    
  344.                     // オブジェクトの配置
  345.                     switch (tile[x][y]) {
  346.                     case '#': // 壁
  347.                         break;
  348.                     case ' ': // 空きマス
  349.                         break;
  350.                     case '.': // ドット
  351.                         dcount++;
  352.                         dcountx[x]++;
  353.                         dcounty[y]++;
  354.                         dcountxy[x][y]++;
  355.                         break;
  356.                     case '@': // 自機
  357.                         amove[0][0] = x;
  358.                         amove[0][1] = y;
  359.                         amove[0][3] = branch[x][y];
  360.                         amove[0][4] = -1;
  361.                         break;
  362.                     case 'V': // 敵 V
  363.                         vmove[vcount][0][0] = x;
  364.                         vmove[vcount][0][1] = y;
  365.                         vmove[vcount][0][2] = theory[x][y];
  366.                         vcount++;
  367.                         break;
  368.                     case 'H': // 敵 H
  369.                         hmove[hcount][0][0] = x;
  370.                         hmove[hcount][0][1] = y;
  371.                         hmove[hcount][0][2] = theory[x][y];
  372.                         hcount++;
  373.                         break;
  374.                     case 'L': // 敵 L
  375.                         lmove[lcount][0][0] = x;
  376.                         lmove[lcount][0][1] = y;
  377.                         lmove[lcount][0][2] = theory[x][y];
  378.                         lcount++;
  379.                         break;
  380.                     case 'R': // 敵 R
  381.                         rmove[rcount][0][0] = x;
  382.                         rmove[rcount][0][1] = y;
  383.                         rmove[rcount][0][2] = theory[x][y];
  384.                         rcount++;
  385.                         break;
  386.                     case 'J': // 敵 J
  387.                         jmove[jcount][0][0] = x;
  388.                         jmove[jcount][0][1] = y;
  389.                         jmove[jcount][0][2] = theory[x][y];
  390.                         jcount++;
  391.                         break;
  392.                     }
  393.                 }
  394.             }
  395.         }
  396.         System.out.println("マップテーブル作成完了 " + new Date());
  397.  
  398.         // LRJは行動が決定的なのであらかじめ計算しておく
  399.         for (int t = 0; t < cutheight; t++) {
  400.             int m = 0, n = 0, x = 0, y = 0;
  401.             for (int l = 0; l < lcount; l++) {
  402.                 m = lmove[l][t][2];
  403.                 x = lmove[l][t][0] + move[m][0];
  404.                 y = lmove[l][t][1] + move[m][1];
  405.  
  406.                 lmove[l][t+1][0] = x;
  407.                 lmove[l][t+1][1] = y;
  408.                 lmove[l][t+1][2] = ltheory[m][x][y];
  409.             }
  410.             for (int r = 0; r < rcount; r++) {
  411.                 m = rmove[r][t][2];
  412.                 x = rmove[r][t][0] + move[m][0];
  413.                 y = rmove[r][t][1] + move[m][1];
  414.  
  415.                 rmove[r][t+1][0] = x;
  416.                 rmove[r][t+1][1] = y;
  417.                 rmove[r][t+1][2] = rtheory[m][x][y];
  418.             }
  419.             for (int j = 0; j < jcount; j++) {
  420.                 m = jmove[j][t][2];
  421.                 x = jmove[j][t][0] + move[m][0];
  422.                 y = jmove[j][t][1] + move[m][1];
  423.                 n = jmove[j][t][3];
  424.  
  425.                 if (n == 0) {
  426.                     jmove[j][t+1][0] = x;
  427.                     jmove[j][t+1][1] = y;
  428.                     jmove[j][t+1][2] = ltheory[m][x][y];
  429.                     if (branch[x][y] >= 3) n = 1;
  430.                     jmove[j][t+1][3] = n;
  431.                    
  432.                 } else {
  433.                     jmove[j][t+1][0] = x;
  434.                     jmove[j][t+1][1] = y;
  435.                     jmove[j][t+1][2] = rtheory[m][x][y];
  436.                     if (branch[x][y] >= 3) n = 0;
  437.                     jmove[j][t+1][3] = n;
  438.                 }
  439.             }
  440.         }
  441.         System.out.println("LRJ移動テーブル作成完了 " + new Date());
  442.        
  443.  
  444.         // ここからゼロシステムで未来予知
  445.         for (int t = 1; t < tsize; t++) {
  446.             for (int m = 0; m < 6; m++) {
  447.                 for (int x = 0; x < xsize; x++) {
  448.                     for (int y = 0; y < ysize; y++) {
  449.                         atheory[t][m][x][y] = atheory[0][m][x][y];
  450.                     }
  451.                 }
  452.             }
  453.         }      
  454.  
  455.         // atheoryの1手読み
  456.         for (int t = 0; t < tsize - 1; t++) {
  457.             for (int m = 0; m < 6; m++) {
  458.                 for (int x = 1; x < xsize - 1; x++) {
  459.                     for (int y = 1; y < ysize - 1; y++) {
  460.                         if (atheory[t][m][x][y] > 0) {
  461.                             for (int c = 1; c < 5; c++) {
  462.                                 if (((atheory[t][m][x][y] & bits[c])> 0) && preattack(t,x,y,x + move[c][0],y + move[c][1])) {
  463.                                     atheory[t][m][x][y] = (byte)(atheory[t][m][x][y] & bitsoff[c]);
  464.                                     if (branch[x+move[c][0]][y+move[c][1]] > 2) {
  465.                                         atheory[t][m][x][y] = (byte)(atheory[t][m][x][y] | bits[5]);
  466.                                     }
  467.                                 }
  468.                             }
  469.                             if (((atheory[t][m][x][y] & bits[5])> 0) && preattack(t,x,y,x + move[5][0],y + move[5][1])) {
  470.                                 atheory[t][m][x][y] = (byte)(atheory[t][m][x][y] & bitsoff[5]);
  471.                             }
  472.                         }
  473.                     }
  474.                 }
  475.             }
  476.         }      
  477.  
  478.         // btheoryにコピー
  479.         for (int t = 0; t < cutlength + 1; t++) {
  480.             for (int m = 0; m < 6; m++) {
  481.                 for (int x = 1; x < xsize - 1; x++) {
  482.                     for (int y = 1; y < ysize - 1; y++) {
  483.                         btheory[t][m][x][y][0] = atheory[t + cutheight - cutlength][m][x][y];
  484.                         for (int d = 1; d < cutlength + 1; d++) {
  485.                             btheory[t][m][x][y][d] = btheory[t][m][x][y][0];
  486.                         }
  487.                     }
  488.                 }
  489.             }
  490.         }      
  491.  
  492.         // btheoryの詰め 終盤の残りi回の移動をLRJから逃げ切る
  493.         for (int i = 2; i < cutlength + 1; i++) {
  494.             for (int t = 0; t < cutlength; t++) {
  495.                 for (int m = 0; m < 6; m++) {
  496.                     for (int x = 1; x < xsize - 1; x++) {
  497.                         for (int y = 1; y < ysize - 1; y++) {
  498.                             if (t > cutlength - i) {
  499.                                 btheory[t][m][x][y][i] = 0;
  500.                             } else {
  501.                                 for (int c = 1; c < 6; c++) {
  502.                                     if (btheory[t+1][c][x+move[c][0]][y+move[c][1]][i-1] == 0) btheory[t][m][x][y][i] = (byte)(btheory[t][m][x][y][i] & bitsoff[c]);
  503.                                 }
  504.                             }
  505.                         }
  506.                     }
  507.                 }
  508.             }
  509.         }
  510.  
  511.         // atheoryの詰め 中盤までの移動をLRJから逃げ切る
  512.         for (int t = cutheight - cutlength - 1; t >= 0; t--) {
  513.             for (int m = 0; m < 6; m++) {
  514.                 for (int x = 1; x < xsize - 1; x++) {
  515.                     for (int y = 1; y < ysize - 1; y++) {
  516.                         for (int c = 1; c < 6; c++) {
  517.                             if (atheory[t+1][c][x+move[c][0]][y+move[c][1]] == 0) atheory[t][m][x][y] = (byte)(atheory[t][m][x][y] & bitsoff[c]);
  518.                         }
  519.                     }
  520.                 }
  521.             }
  522.         }      
  523.        
  524.         System.out.println("@移動テーブル作成完了 " + new Date());
  525.        
  526.  
  527.         // 基本となる探索ループ
  528.         int bestscore = cutscore;
  529.         int beststeps = 0;
  530.         int finishcount = 0;
  531.         int offsetcount = 0;
  532.         long searchcount = 0;
  533.         int t = 0;
  534.         int m = 0, x = 0, y = 0, x2 = 0, y2 = 0;
  535.         while (true) {
  536.             x = amove[t][0];
  537.             y = amove[t][1];
  538.            
  539.             // 移動方針が決まってない=この枝がこのtに初めて来た場合
  540.             if (amove[t][4] < 0) {
  541.                 // ドットを食べよう
  542.                 if (dcountxy[x][y] > 0) {
  543.                     dcountxy[x][y]--;
  544.                     dcountx[x]--;
  545.                     dcounty[y]--;
  546.                     dcount--;
  547.                     amove[t][5] = 1;
  548.                    
  549.                 } else {
  550.                     amove[t][5] = 0;
  551.                 }
  552.                 amove[t][6] = dcount;
  553.                 amove[t][7] = dcount;
  554.  
  555.                 // フィニッシュ
  556.                 if (dcount == 0) {
  557.                     finishcount++;
  558.                     if (bestscore > t) {
  559.                         bestscore = t;
  560.                         beststeps = offsetcount;
  561.                         System.out.println("" + finishcount + "フィニッシュ" + bestscore + " " + new Date());
  562.                         for (int tt = 0; tt < t; tt++) {
  563.                             System.out.print("?jhkl.".charAt(amove[tt][2]));
  564.                         }
  565.                         System.out.println();
  566.                         // フィニッシュした枝には足切りボーナス
  567.                         if (ashikiri > 0) {
  568.                             if (cutheight > cutlength) amove[cutheight - cutlength][8] += cutlength * cutlength;
  569.                             if (cutheight > cutlength * 2) amove[cutheight - cutlength * 2][8] += cutlength;
  570.                         }
  571.                     }
  572.                     while ((t >= 0) && (amove[t][4] <= 0)){
  573.                         if (amove[t][5] > 0) {
  574.                             x = amove[t][0];
  575.                             y = amove[t][1];
  576.                             dcount++;
  577.                             dcountx[x]++;
  578.                             dcounty[y]++;
  579.                             dcountxy[x][y]++;
  580.                         }
  581.                         t--;
  582.                     }
  583.                     if (t < 0) break;
  584.                     continue;
  585.                 }
  586.  
  587.                 if (t == cutoffset) {
  588.                     offsetcount++;
  589.                     System.out.println("" + amove[0][4] + "-" + offsetcount + " " + new Date());
  590.                     if (skipsteps > offsetcount) {
  591.                         while ((t >= 0) && (amove[t][4] <= 0)){
  592.                             if (amove[t][5] > 0) {
  593.                                 x = amove[t][0];
  594.                                 y = amove[t][1];
  595.                                 dcount++;
  596.                                 dcountx[x]++;
  597.                                 dcounty[y]++;
  598.                                 dcountxy[x][y]++;
  599.                             }
  600.                             t--;
  601.                         }
  602.                         if (t < 0) break;
  603.                         continue;
  604.                     }
  605.                 } else if (t == cutheight - cutlength) {
  606.                     searchcount++;
  607.                 }
  608.                
  609.                 // 足切り
  610.                 if (ashikiri > 0) {
  611.                     if ((t % cutlength) == 0) {
  612.                         if (t == cutlength) {
  613.                             if (--amove[cutoffset][8] < 0) {
  614.                                 int rollback = cutoffset;
  615.                                 while ((t >= 0) && ((t > rollback) || (amove[t][4] <= 0))){
  616.                                     if (amove[t][5] > 0) {
  617.                                         x = amove[t][0];
  618.                                         y = amove[t][1];
  619.                                         dcount++;
  620.                                         dcountx[x]++;
  621.                                         dcounty[y]++;
  622.                                         dcountxy[x][y]++;
  623.                                     }
  624.                                     t--;
  625.                                 }
  626.                                 if (t < 0) break;
  627.                                 continue;
  628.                             }
  629.                         } else if (t > 0) {
  630.                             if (--amove[(t - cutlength)][8] < 0) {
  631.                                 int rollback = t  - cutlength;
  632.                                 while ((t >= 0) && ((t > rollback) || (amove[t][4] <= 0))){
  633.                                     if (amove[t][5] > 0) {
  634.                                         x = amove[t][0];
  635.                                         y = amove[t][1];
  636.                                         dcount++;
  637.                                         dcountx[x]++;
  638.                                         dcounty[y]++;
  639.                                         dcountxy[x][y]++;
  640.                                     }
  641.                                     t--;
  642.                                 }
  643.                                 if (t < 0) break;
  644.                                 continue;
  645.                             }
  646.                         }
  647.                     }
  648.                 }
  649.  
  650.                 // 手遅れ
  651.                 if (dcount >= (bestscore - t)) {
  652.                     while ((t >= 0) && (amove[t][4] <= 0)){
  653.                         if (amove[t][5] > 0) {
  654.                             x = amove[t][0];
  655.                             y = amove[t][1];
  656.                             dcount++;
  657.                             dcountx[x]++;
  658.                             dcounty[y]++;
  659.                             dcountxy[x][y]++;
  660.                         }
  661.                         t--;
  662.                     }
  663.                     if (t < 0) break;
  664.                     continue;
  665.                 }
  666.                
  667.                 // VHの移動処理
  668.                 int vx = 0, vy = 0, vm = 0;
  669.                 for (int v = 0; v < vcount; v++) {
  670.                     vm = vmove[v][t][2];
  671.                     if (vm > 4) { vm = vthink(v, t); }
  672.                     vx = vmove[v][t][0] + move[vm][0];
  673.                     vy = vmove[v][t][1] + move[vm][1];
  674.                     vmove[v][t+1][0] = vx;
  675.                     vmove[v][t+1][1] = vy;
  676.                     vmove[v][t+1][2] = vtheory[vm][vx][vy];
  677.                 }
  678.                 for (int h = 0; h < hcount; h++) {
  679.                     vm = hmove[h][t][2];
  680.                     if (vm > 4) { vm = hthink(h, t); }
  681.                     vx = hmove[h][t][0] + move[vm][0];
  682.                     vy = hmove[h][t][1] + move[vm][1];
  683.                     hmove[h][t+1][0] = vx;
  684.                     hmove[h][t+1][1] = vy;
  685.                     hmove[h][t+1][2] = vtheory[vm][vx][vy];
  686.                 }
  687.                
  688.                 // @の移動方針を決める
  689.                 if (t == 0) athink(t, x, y, 0); else athink(t, x, y, amove[t-1][2]);
  690.  
  691.                 // 打つ手が無い
  692.                 if (amove[t][4] == 0) {
  693.                     while ((t >= 0) && (amove[t][4] <= 0)){
  694.                         if (amove[t][5] > 0) {
  695.                             x = amove[t][0];
  696.                             y = amove[t][1];
  697.                             dcount++;
  698.                             dcountx[x]++;
  699.                             dcounty[y]++;
  700.                             dcountxy[x][y]++;
  701.                         }
  702.                         t--;
  703.                     }
  704.                     if (t < 0) break;
  705.                     continue;
  706.                 }
  707.  
  708.             }
  709.  
  710.             // いよいよ@が移動しますよ
  711.             amove[t][4]--;
  712.             amove[t][8] = ashikiri;
  713.            
  714.             m = atest[t][amove[t][4]];
  715.             amove[t][2] = m;
  716.              
  717.             x2 = x + move[m][0];
  718.             y2 = y + move[m][1];
  719.            
  720.             // 敵に捕まった
  721.             if (level % 2 == 1) {
  722.                 if (attack(t,x,y,x2,y2)) {
  723.                     while ((t >= 0)&&(amove[t][4] <= 0)) {
  724.                         if (amove[t][5] > 0) {
  725.                             x = amove[t][0];
  726.                             y = amove[t][1];
  727.                             dcount++;
  728.                             dcountx[x]++;
  729.                             dcounty[y]++;
  730.                             dcountxy[x][y]++;
  731.                         }
  732.                         t--;
  733.                     }
  734.                     if (t < 0) break;
  735.                     continue;
  736.                 }
  737.             }
  738.            
  739.             // 時間が流れてゆく
  740.             t++;
  741.             x = amove[t-1][0] + move[amove[t-1][2]][0];
  742.             y = amove[t-1][1] + move[amove[t-1][2]][1];
  743.             amove[t][0] = x;
  744.             amove[t][1] = y;
  745.             amove[t][2] = 0;
  746.             amove[t][3] = branch[x][y];
  747.             amove[t][4] = -1;
  748.         }
  749.  
  750.         // 結果は途中で出るので最後は要約だけ 探索指数は終盤に差し掛かった枝の数
  751.         System.out.println("" + finishcount + "パターン" + bestscore + " step" + beststeps + " 探索指数"  + searchcount + " "+ new Date());
  752.     }
  753.    
  754.     // ∴さて‥‥どこへ行こうか?
  755.     private static void athink(int t, int x, int y, int m) {
  756.         int[] result = new int[6];
  757.         int rescount = 0;
  758.  
  759.         int flags = (t >= (cutheight - cutlength)) ? btheory[t - (cutheight - cutlength)][m][x][y][dcount] : atheory[t][m][x][y];
  760.  
  761.         // 手詰まり
  762.         if (flags == 0) {
  763.             amove[t][4] = 0;
  764.             return;
  765.         }
  766.        
  767.         // 立ち止まる
  768.         if ((flags & bits[5]) > 0) {
  769.             result[rescount++] = 5;
  770.             flags = flags & bitsoff[5];
  771.         }
  772.  
  773.         // 一方向にしか進めない時は考える必要もない
  774.         if ((flags != 1)&&(flags != 2)&&(flags != 4)&&(flags != 8)) {
  775.             // 目の前の餌
  776.             if (flags > 0) {
  777.                 if ((y - ysize / 2) > 0) {
  778.                     if (((flags & bits[1]) > 0) && (dcountxy[x][y + 1] > 0)) {
  779.                         result[rescount++] = 1;
  780.                         flags = flags & bitsoff[1];
  781.                     }
  782.                     if ((x - xsize / 2) > 0) {
  783.                         if (((flags & bits[4]) > 0) && (dcountxy[x + 1][y] > 0)) {
  784.                             result[rescount++] = 4;
  785.                             flags = flags & bitsoff[4];
  786.                         }
  787.                         if (((flags & bits[2]) > 0) && (dcountxy[x - 1][y] > 0)) {
  788.                             result[rescount++] = 2;
  789.                             flags = flags & bitsoff[2];
  790.                         }
  791.                     } else {
  792.                         if (((flags & bits[2]) > 0) && (dcountxy[x - 1][y] > 0)) {
  793.                             result[rescount++] = 2;
  794.                             flags = flags & bitsoff[2];
  795.                         }
  796.                         if (((flags & bits[4]) > 0) && (dcountxy[x + 1][y] > 0)) {
  797.                             result[rescount++] = 4;
  798.                             flags = flags & bitsoff[4];
  799.                         }
  800.                     }
  801.                     if (((flags & bits[3]) > 0) && (dcountxy[x][y - 1] > 0)) {
  802.                         result[rescount++] = 3;
  803.                         flags = flags & bitsoff[3];
  804.                     }
  805.                 } else {
  806.                     if (((flags & bits[3]) > 0) && (dcountxy[x][y - 1] > 0)) {
  807.                         result[rescount++] = 3;
  808.                         flags = flags & bitsoff[3];
  809.                     }
  810.                     if ((x - xsize / 2) > 0) {
  811.                         if (((flags & bits[4]) > 0) && (dcountxy[x + 1][y] > 0)) {
  812.                             result[rescount++] = 4;
  813.                             flags = flags & bitsoff[4];
  814.                         }
  815.                         if (((flags & bits[2]) > 0) && (dcountxy[x - 1][y] > 0)) {
  816.                             result[rescount++] = 2;
  817.                             flags = flags & bitsoff[2];
  818.                         }
  819.                     } else {
  820.                         if (((flags & bits[2]) > 0) && (dcountxy[x - 1][y] > 0)) {
  821.                             result[rescount++] = 2;
  822.                             flags = flags & bitsoff[2];
  823.                         }
  824.                         if (((flags & bits[4]) > 0) && (dcountxy[x + 1][y] > 0)) {
  825.                             result[rescount++] = 4;
  826.                             flags = flags & bitsoff[4];
  827.                         }
  828.                     }
  829.                     if (((flags & bits[1]) > 0) && (dcountxy[x][y + 1] > 0)) {
  830.                         result[rescount++] = 1;
  831.                         flags = flags & bitsoff[1];
  832.                     }
  833.                 }
  834.        
  835.                 // すぐ近くの餌
  836.                 if (flags > 0) {
  837.                     if ((y - ysize / 2) > 0) {
  838.                         if (((flags & bits[1]) > 0) && (dcountxy[x][y + 2] > 0)) {
  839.                             result[rescount++] = 1;
  840.                             flags = flags & bitsoff[1];
  841.                         }
  842.                         if ((x - xsize / 2) > 0) {
  843.                             if (((flags & bits[4]) > 0) && (dcountxy[x + 2][y] > 0)) {
  844.                                 result[rescount++] = 4;
  845.                                 flags = flags & bitsoff[4];
  846.                             }
  847.                             if (((flags & bits[2]) > 0) && (dcountxy[x - 2][y] > 0)) {
  848.                                 result[rescount++] = 2;
  849.                                 flags = flags & bitsoff[2];
  850.                             }
  851.                         } else {
  852.                             if (((flags & bits[2]) > 0) && (dcountxy[x - 2][y] > 0)) {
  853.                                 result[rescount++] = 2;
  854.                                 flags = flags & bitsoff[2];
  855.                             }
  856.                             if (((flags & bits[4]) > 0) && (dcountxy[x + 2][y] > 0)) {
  857.                                 result[rescount++] = 4;
  858.                                 flags = flags & bitsoff[4];
  859.                             }
  860.                         }
  861.                         if (((flags & bits[3]) > 0) && (dcountxy[x][y - 2] > 0)) {
  862.                             result[rescount++] = 3;
  863.                             flags = flags & bitsoff[3];
  864.                         }
  865.                     } else {
  866.                         if (((flags & bits[3]) > 0) && (dcountxy[x][y - 2] > 0)) {
  867.                             result[rescount++] = 3;
  868.                             flags = flags & bitsoff[3];
  869.                         }
  870.                         if ((x - xsize / 2) > 0) {
  871.                             if (((flags & bits[4]) > 0) && (dcountxy[x + 2][y] > 0)) {
  872.                                 result[rescount++] = 4;
  873.                                 flags = flags & bitsoff[4];
  874.                             }
  875.                             if (((flags & bits[2]) > 0) && (dcountxy[x - 2][y] > 0)) {
  876.                                 result[rescount++] = 2;
  877.                                 flags = flags & bitsoff[2];
  878.                             }
  879.                         } else {
  880.                             if (((flags & bits[2]) > 0) && (dcountxy[x - 2][y] > 0)) {
  881.                                 result[rescount++] = 2;
  882.                                 flags = flags & bitsoff[2];
  883.                             }
  884.                             if (((flags & bits[4]) > 0) && (dcountxy[x + 2][y] > 0)) {
  885.                                 result[rescount++] = 4;
  886.                                 flags = flags & bitsoff[4];
  887.                             }
  888.                         }
  889.                         if (((flags & bits[1]) > 0) && (dcountxy[x][y + 2] > 0)) {
  890.                             result[rescount++] = 1;
  891.                             flags = flags & bitsoff[1];
  892.                         }
  893.                     }
  894.            
  895.                     // 餌が多そうな方
  896.                     if (flags > 0) {
  897.                         int xl = 0, xh = 0, yl = 0, yh = 0;
  898.                         for (int xx = 0; xx < x; xx++) {
  899.                             xl += dcountx[xx];
  900.                         }
  901.                         for (int xx = x + 1; xx < xsize; xx++) {
  902.                             xh += dcountx[xx];
  903.                         }
  904.                         for (int yy = 0; yy < y; yy++) {
  905.                             yl += dcounty[yy];
  906.                         }
  907.                         for (int yy = 0; yy < ysize; yy++) {
  908.                             yh += dcounty[yy];
  909.                         }
  910.                         xl = xl * (xsize - x - 1) * ysize;
  911.                         xh = xh * (x - 1) * ysize;
  912.                         yl = yl * (ysize - y - 1) * xsize;
  913.                         yh = yh * (y - 1) * xsize;
  914.                         int xlh = (xl > xh) ? xl : xh;
  915.                         int ylh = (yl > yh) ? yl : yh;
  916.                         if (xlh > ylh) {
  917.                             if (xl > xh) {
  918.                                 if ((flags & bits[2]) > 0) {
  919.                                     result[rescount++] = 2;
  920.                                     flags = flags & bitsoff[2];
  921.                                 }
  922.                                 if (yl > yh) {
  923.                                     if ((flags & bits[3]) > 0) {
  924.                                         result[rescount++] = 3;
  925.                                         flags = flags & bitsoff[3];
  926.                                     }
  927.                                 } else {
  928.                                     if ((flags & bits[1]) > 0) {
  929.                                         result[rescount++] = 1;
  930.                                         flags = flags & bitsoff[1];
  931.                                     }
  932.                                 }
  933.                             } else {
  934.                                 if ((flags & bits[4]) > 0) {
  935.                                     result[rescount++] = 4;
  936.                                     flags = flags & bitsoff[4];
  937.                                 }
  938.                                 if (yl > yh) {
  939.                                     if ((flags & bits[3]) > 0) {
  940.                                         result[rescount++] = 3;
  941.                                         flags = flags & bitsoff[3];
  942.                                     }
  943.                                 } else {
  944.                                     if ((flags & bits[1]) > 0) {
  945.                                         result[rescount++] = 1;
  946.                                         flags = flags & bitsoff[1];
  947.                                     }
  948.                                 }
  949.                             }
  950.                         } else {
  951.                             if (yl > yh) {
  952.                                 if ((flags & bits[3]) > 0) {
  953.                                     result[rescount++] = 3;
  954.                                     flags = flags & bitsoff[3];
  955.                                 }
  956.                                 if (xl > xh) {
  957.                                     if ((flags & bits[2]) > 0) {
  958.                                         result[rescount++] = 2;
  959.                                         flags = flags & bitsoff[2];
  960.                                     }
  961.                                 } else {
  962.                                     if ((flags & bits[4]) > 0) {
  963.                                         result[rescount++] = 4;
  964.                                         flags = flags & bitsoff[4];
  965.                                     }
  966.                                 }
  967.                             } else {
  968.                                 if ((flags & bits[1]) > 0) {
  969.                                     result[rescount++] = 1;
  970.                                     flags = flags & bitsoff[1];
  971.                                 }
  972.                                 if (xl > xh) {
  973.                                     if ((flags & bits[2]) > 0) {
  974.                                         result[rescount++] = 2;
  975.                                         flags = flags & bitsoff[2];
  976.                                     }
  977.                                 } else {
  978.                                     if ((flags & bits[4]) > 0) {
  979.                                         result[rescount++] = 4;
  980.                                         flags = flags & bitsoff[4];
  981.                                     }
  982.                                 }
  983.                             }
  984.                         }
  985.                     }
  986.                 }
  987.             }
  988.         }
  989.  
  990.         // 落ち穂拾い
  991.         if (flags > 0) {
  992.             for (int i = 1; i < 6; i++) {
  993.                 if ((flags & bits[i]) > 0) {
  994.                     result[rescount++] = i;
  995.                 }
  996.             }
  997.         }
  998.  
  999.         // 事実上の戻り値に代入
  1000.         for (int i = 0; i < rescount; i++) {
  1001.             atest[t][i] = result[rescount - i - 1];
  1002.         }
  1003.         amove[t][4] = rescount;
  1004.         return;
  1005.     }
  1006.  
  1007.     // Vは考えた
  1008.     private static int vthink(int v, int t) {
  1009.         int vx = vmove[v][t][0];
  1010.         int vy = vmove[v][t][1];
  1011.         int ax = amove[t][0];
  1012.         int ay = amove[t][1];
  1013.         int dx = ax - vx;
  1014.         int dy = ay - vy;
  1015.        
  1016.         if (dy != 0) {
  1017.             if (dy > 0) {
  1018.                 if (tile[vx][vy + 1] != '#') return 1;
  1019.             } else {
  1020.                 if (tile[vx][vy - 1] != '#') return 3;
  1021.             }
  1022.         }
  1023.         if (dx != 0) {
  1024.             if (dx > 0) {
  1025.                 if (tile[vx + 1][vy] != '#') return 4;
  1026.             } else {
  1027.                 if (tile[vx - 1][vy] != '#') return 2;
  1028.             }
  1029.         }
  1030.         return theory[vx][vy];
  1031.     }
  1032.  
  1033.     // Hは考えた
  1034.     private static int hthink(int h, int t) {
  1035.         int hx = hmove[h][t][0];
  1036.         int hy = hmove[h][t][1];
  1037.         int ax = amove[t][0];
  1038.         int ay = amove[t][1];
  1039.         int dx = ax - hx;
  1040.         int dy = ay - hy;
  1041.        
  1042.         if (dx != 0) {
  1043.             if (dx > 0) {
  1044.                 if (tile[hx + 1][hy] != '#') return 4;
  1045.             } else {
  1046.                 if (tile[hx - 1][hy] != '#') return 2;
  1047.             }
  1048.         }
  1049.         if (dy != 0) {
  1050.             if (dy > 0) {
  1051.                 if (tile[hx][hy + 1] != '#') return 1;
  1052.             } else {
  1053.                 if (tile[hx][hy - 1] != '#') return 3;
  1054.             }
  1055.         }
  1056.         return theory[hx][hy];
  1057.     }
  1058.  
  1059.     // 当たり判定 LRJ
  1060.     private static boolean preattack(int t, int x1, int y1, int x2, int y2) {
  1061.         for (int l = 0; l < lcount; l++) {
  1062.             if ((lmove[l][t][0] == x2)&&(lmove[l][t][1] == y2)&&(lmove[l][t+1][0] == x1)&&(lmove[l][t+1][1] == y1)) return true;
  1063.             if ((lmove[l][t+1][0] == x2)&&(lmove[l][t+1][1] == y2)) return true;
  1064.         }
  1065.         for (int r = 0; r < rcount; r++) {
  1066.             if ((rmove[r][t][0] == x2)&&(rmove[r][t][1] == y2)&&(rmove[r][t+1][0] == x1)&&(rmove[r][t+1][1] == y1)) return true;
  1067.             if ((rmove[r][t+1][0] == x2)&&(rmove[r][t+1][1] == y2)) return true;
  1068.         }
  1069.         for (int j = 0; j < jcount; j++) {
  1070.             if ((jmove[j][t][0] == x2)&&(jmove[j][t][1] == y2)&&(jmove[j][t+1][0] == x1)&&(jmove[j][t+1][1] == y1)) return true;
  1071.             if ((jmove[j][t+1][0] == x2)&&(jmove[j][t+1][1] == y2)) return true;
  1072.         }
  1073.         return false;
  1074.     }
  1075.  
  1076.     // 当たり判定 VH
  1077.     private static boolean attack(int t, int x1, int y1, int x2, int y2) {
  1078.         for (int v = 0; v < vcount; v++) {
  1079.             if ((vmove[v][t][0] == x2)&&(vmove[v][t][1] == y2)&&(vmove[v][t+1][0] == x1)&&(vmove[v][t+1][1] == y1)) return true;
  1080.             if ((vmove[v][t+1][0] == x2)&&(vmove[v][t+1][1] == y2)) return true;
  1081.         }
  1082.         for (int h = 0; h < hcount; h++) {
  1083.             if ((hmove[h][t][0] == x2)&&(hmove[h][t][1] == y2)&&(hmove[h][t+1][0] == x1)&&(hmove[h][t+1][1] == y1)) return true;
  1084.             if ((hmove[h][t+1][0] == x2)&&(hmove[h][t+1][1] == y2)) return true;
  1085.         }
  1086.         return false;
  1087.     }
  1088.  
  1089. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement