⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ptetrics.java~146~

📁 JBuilder实现的具有单机
💻 JAVA~146~
📖 第 1 页 / 共 5 页
字号:
                      move_to_left(after_rotate, nCol);
                    else
                      move_to_right(after_rotate, nCol);

                    break stop;
                  }

                  else if (nCol != 0 && nCol != 9 && checklocal(nRow, nCol) &&
                           checkleft(nRow, nCol)
                           && checkright(nRow, nCol)
                           &&check_movedown(nCol-1,nCol+1,nRow+1)) {
                    after_rotate = this.c_curPiece[0].m_nColumn;
                    if (nCol < after_rotate)
                      move_to_left(after_rotate, nCol);
                    else
                      move_to_right(after_rotate, nCol);
                    break stop;
                  }
                  else if(nRow==0){
                  if(this.isWide_num(0,nCol,3)&&check_movedown(nCol,nCol+2,1)){
                    after_rotate = this.c_curPiece[0].m_nColumn;

                  if(nCol<after_rotate)
                    move_to_left(after_rotate-1,nCol);
                  else
                    move_to_right(after_rotate-1,nCol);
                  break stop;

                }
              }
                  else if(nRow==18) {
                    cmoveCurPiece(0, -1, false);
                    repaint();
                    System.out.print("m1 ");
                    break stop;
                  }
            }

            break;

        case 2:
          stop:{
            for(nRow=0;nRow<m_nRows;nRow++)
              for(nCol=0;nCol<m_nCols;nCol++)
                if(nCol>0&&checklocal(nRow,nCol)&&!checkleft(nRow,nCol)
                        &&check_movedown(nCol-1,nCol,nRow+1)
                        &&check_moveline(nCol-1,nCol-1,nRow)&&check_moveline(nCol-1,nCol,nRow+1)){
                  cmoveCurPiece(0, 0, true);repaint();
                  after_rotate = this.c_curPiece[0].m_nColumn;
                  if(nCol<after_rotate)
                    move_to_left(after_rotate,nCol);
                  else
                    move_to_right(after_rotate,nCol);

                  System.out.print("22 ");
                  break stop;
                }


                else if(nCol<8&&checklocal(nRow,nCol)&&!checklocal(nRow,nCol+1)&&
                  !checklocal(nRow,nCol+2)&&check_movedown(nCol,nCol+2,nRow+1)
                  &&checkdown(nRow,nCol+1)&&checkdown(nRow,nCol+2))
                {
                 after_rotate = this.c_curPiece[0].m_nColumn;
                  if(nCol<after_rotate)
                    move_to_left(after_rotate-1,nCol);
                  else
                    move_to_right(after_rotate-1,nCol);
                  System.out.print("21 ");
                break stop;
                }
                else if(nCol>0&&checklocal(nRow,nCol)&&!checkleft(nRow,nCol)
                        &&check_movedown(nCol-1,nCol,nRow+1)&&checkdown(nRow,nCol-1)){
                  cmoveCurPiece(0, 0, true);repaint();
                  after_rotate = this.c_curPiece[0].m_nColumn;
                  if(nCol<after_rotate)
                    move_to_left(after_rotate,nCol);
                  else
                    move_to_right(after_rotate,nCol);

                  System.out.print("22 ");
                  break stop;
                }

                else if(nCol<8&&checklocal(nRow,nCol)&&!checklocal(nRow,nCol+1)&&
                  !checklocal(nRow,nCol+2)&&check_movedown(nCol,nCol+2,nRow+1))
                {
                 after_rotate = this.c_curPiece[0].m_nColumn;
                  if(nCol<after_rotate)
                    move_to_left(after_rotate-1,nCol);
                  else
                    move_to_right(after_rotate-1,nCol);
                  System.out.print("21 ");
                break stop;
                }
                else if(nCol>0&&checklocal(nRow,nCol)&&!checkleft(nRow,nCol)
                        &&check_movedown(nCol-1,nCol,nRow+1)){
                  cmoveCurPiece(0, 0, true);repaint();
                  after_rotate = this.c_curPiece[0].m_nColumn;
                  if(nCol<after_rotate)
                    move_to_left(after_rotate,nCol);
                  else
                    move_to_right(after_rotate,nCol);

                  System.out.print("22 ");
                  break stop;
                }
                else if(nRow==0){
                  if(this.isWide_num(0,nCol,2)&&check_movedown(nCol,nCol+1,1)){
                    cmoveCurPiece(0, 0, true);
                    repaint();
                    after_rotate = this.c_curPiece[0].m_nColumn;

                  if(nCol<after_rotate)
                    move_to_left(after_rotate,nCol);
                  else
                    move_to_right(after_rotate,nCol);
                  break stop;

                  }
                }
                else if(nRow==18) {
                  cmoveCurPiece(0,-1,false);
                  repaint();
                  System.out.print("m2 ");
                  break stop;
                }

            }
            break;

          case 3:
            stop:{
            for(nRow=0;nRow<m_nRows;nRow++)
              for(nCol=0;nCol<m_nCols;nCol++)
                if(nCol<9&&checklocal(nRow,nCol)
                        &&!checkright(nRow,nCol)
                        &&check_movedown(nCol,nCol+1,nRow+1)
                        &&check_moveline(nCol+1,nCol+1,nRow)&&check_moveline(nCol,nCol+1,nRow+1)){
                  cmoveCurPiece(0, 0, true);repaint();
                  after_rotate = this.c_curPiece[0].m_nColumn;
                  if(nCol<after_rotate)
                    move_to_left(after_rotate-1,nCol);
                  else
                    move_to_right(after_rotate-1,nCol);
                break stop;
                }


                else if(nCol>1&&checklocal(nRow,nCol)&&!checklocal(nRow,nCol-1)&&
                  !checklocal(nRow,nCol-2)&&check_movedown(nCol-2,nCol,nRow+1)
                  &&checkdown(nRow,nCol-1)&&checkdown(nRow,nCol-2))
                {
                 after_rotate = this.c_curPiece[0].m_nColumn;
                  if(nCol<after_rotate)
                    move_to_left(after_rotate+1,nCol);
                  else
                    move_to_right(after_rotate+1,nCol);
                break stop;
                }

                else if(nCol<9&&checklocal(nRow,nCol)
                        &&!checkright(nRow,nCol)&&checkdown(nRow,nCol+1)
                        &&check_movedown(nCol,nCol+1,nRow+1)){
                  cmoveCurPiece(0, 0, true);repaint();
                  after_rotate = this.c_curPiece[0].m_nColumn;
                  if(nCol<after_rotate)
                    move_to_left(after_rotate-1,nCol);
                  else
                    move_to_right(after_rotate-1,nCol);
                break stop;
                }


                else if(nCol>1&&checklocal(nRow,nCol)&&!checklocal(nRow,nCol-1)&&
                  !checklocal(nRow,nCol-2)&&check_movedown(nCol-2,nCol,nRow+1))
                {
                 after_rotate = this.c_curPiece[0].m_nColumn;
                  if(nCol<after_rotate)
                    move_to_left(after_rotate+1,nCol);
                  else
                    move_to_right(after_rotate+1,nCol);
                break stop;
                }
                else if(nCol<9&&checklocal(nRow,nCol)
                        &&!checkright(nRow,nCol)
                        &&check_movedown(nCol,nCol+1,nRow+1)){
                  cmoveCurPiece(0, 0, true);repaint();
                  after_rotate = this.c_curPiece[0].m_nColumn;
                  if(nCol<after_rotate)
                    move_to_left(after_rotate-1,nCol);
                  else
                    move_to_right(after_rotate-1,nCol);
                break stop;
                }
                else if(nRow==0){
                  if (this.isWide_num(0, nCol, 3)&&check_movedown(nCol,nCol+2,1)) {

                    after_rotate = this.c_curPiece[0].m_nColumn;

                    if (nCol < after_rotate)
                      move_to_left(after_rotate-1, nCol);
                    else
                      move_to_right(after_rotate-1, nCol);
                    break stop;
                  }
                  else if(this.isWide_num(0, nCol, 2)&&check_movedown(nCol,nCol+1,1)){
                    cmoveCurPiece(0, 0, true);repaint();
                    after_rotate = this.c_curPiece[0].m_nColumn;
                    if (nCol < after_rotate)
                      move_to_left(after_rotate-1, nCol);
                    else
                      move_to_right(after_rotate-1, nCol);
                    break stop;

                  }
                }

                else if(nRow==18){
                  cmoveCurPiece(0,-1,false);
                  repaint();
                  System.out.print("m3 ");
                  break stop;
                }
            }
            break;

            case 4:
              stop:{
                for (nRow = 0; nRow < m_nRows; nRow++)
                  for (nCol = 0; nCol < m_nCols; nCol++)
                    if (nCol > 0 && checklocal(nRow,nCol) &&
                        checklocal(nRow, nCol - 1)
                        && checkright(nRow + 1, nCol) && checkright(nRow + 2, nCol) &&
                        checkleft(nRow + 1, nCol - 1) && checkleft(nRow + 2, nCol - 1)
                        &&check_movedown(nCol-1,nCol,nRow+1)) {

                      after_rotate = this.c_curPiece[0].m_nColumn;
                      if (nCol < after_rotate)
                        move_to_left(after_rotate+1, nCol);
                      else
                        move_to_right(after_rotate+1, nCol);
                      System.out.print("41 ");
                      break stop;
                    }
                    else if (nCol < 9 && nRow < 18 && checklocal(nRow, nCol) &&
                             checklocal(nRow, nCol + 1) &&
                             check_movedown(nCol,nCol+1,nRow+1)) {

                      after_rotate = this.c_curPiece[0].m_nColumn;
                      if (nCol < after_rotate)
                        move_to_left(after_rotate, nCol);
                      else
                        move_to_right(after_rotate, nCol);
                      System.out.print("42 ");
                      break stop;

                    }
                    else if (nCol < 9 && nRow < 18 && checklocal(nRow, nCol) &&
                             checkleft(nRow + 1, nCol) &&
                             checkleft(nRow + 2, nCol) &&
                             checkright(nRow + 1, nCol + 1) &&
                             checkright(nRow + 2, nCol + 1)&&
                             check_movedown(nCol,nCol+1,nRow+1)) {

                      after_rotate = this.c_curPiece[0].m_nColumn;
                      if (nCol < after_rotate)
                        move_to_left(after_rotate, nCol);
                      else
                        move_to_right(after_rotate, nCol);
                      System.out.print("43 ");
                      break stop;

                    }
                    else if (nCol > 0 && nRow < 18 && checklocal(nRow, nCol) &&
                             checkright(nRow + 1, nCol) &&
                             checkright(nRow + 2, nCol) &&
                             checkleft(nRow + 1, nCol - 1) &&
                             checkleft(nRow + 2, nCol - 1)&&
                             check_movedown(nCol-1,nCol,nRow+1)) {

                      after_rotate = this.c_curPiece[0].m_nColumn;
                      if (nCol < after_rotate)
                        move_to_left(after_rotate+1, nCol);
                      else
                        move_to_right(after_rotate+1, nCol);

                      System.out.print("44 ");
                      break stop;

                    }

                    else if(nRow==0){
                    if (this.isWide_num(0, nCol, 2)&&check_movedown(nCol,nCol+1,1)) {
                    after_rotate = this.c_curPiece[0].m_nColumn;
                    if (nCol < after_rotate)
                      move_to_left(after_rotate, nCol);
                    else
                      move_to_right(after_rotate, nCol);
                    System.out.print("45 ");
                    break stop;
                  }
                }

                    else if(nRow==18){

                    for (nRow = 0; nRow < m_nRows; nRow++)
                      for (nCol = 0; nCol < m_nCols; nCol++)
                         if (nCol > 0 && nRow < 18 && checklocal(nRow, nCol) &&
                             check_movedown(nCol-1,nCol,nRow+1)) {

                      after_rotate = this.c_curPiece[0].m_nColumn;
                      if (nCol < after_rotate)
                        move_to_left(after_rotate+1, nCol);
                      else
                        move_to_right(after_rotate+1, nCol);

                      System.out.print("45 ");
                      break stop;

                    }
                    else if (nCol <9 && nRow < 18 && checklocal(nRow, nCol) &&
                             check_movedown(nCol,nCol+1,nRow+1)) {

                      after_rotate = this.c_curPiece[0].m_nColumn;
                      if (nCol < after_rotate)
                        move_to_left(after_rotate, nCol);
                      else
                        move_to_right(after_rotate, nCol);

                      System.out.print("46 ");
                      break stop;

                    }
                    else {
                      cmoveCurPiece(0, -1, false);
                      repaint();
                      System.out.print("m4 ");
                      break stop;
                    }
                  }
              }

             break;

             case 5:
               stop:{
               for(nRow=0;nRow<m_nRows;nRow++)
                for(nCol=0;nCol<m_nCols;nCol++)
                  if(nCol<9&&checkleft(nRow,nCol)&&checkright(nRow,nCol)
                   &&checkleft(nRow+1,nCol)&&checkright(nRow+1,nCol)&&
                   !checklocal(nRow,nCol)&&!checklocal(nRow+1,nCol)
                   &&check_movedown(nCol,nCol+1,nRow+2)
                   &&check_moveline(nCol,nCol,nRow)&&check_moveline(nCol,nCol,nRow+1)
                   &&check_moveline(nCol,nCol+1,nRow+2))
                 {
                  cmoveCurPiece(0, 0, true);repaint();
                  after_rotate = this.c_curPiece[0].m_nColumn;
                   if(nCol<after_rotate)
                     move_to_left(after_rotate,nCol);
                   else
                     move_to_right(after_rotate,nCol);

                   break stop;
                 }

                else if(nCol<9&&checkleft(nRow,nCol)&&checkright(nRow,nCol)
                        &&checkleft(nRow+1,nCol)&&checkright(nRow+1,nCol)&&
                        !checklocal(nRow,nCol)&&!checklocal(nRow+1,nCol)
                        &&check_movedown(nCol,nCol+1,nRow+2)
                        &&check_moveline(nCol,nCol,nRow)&&check_moveline(nCol,nCol,nRow+1))
                {
                  cmoveCurPiece(0, 0, true);repaint();
                  after_rotate = this.c_curPiece[0].m_nColumn;
                  if(nCol<after_rotate)
                    move_to_left(after_rotate,nCol);
                  else
                    move_to_right(after_rotate,nCol);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -