船运动功能不寻找中断 [英] Rook movement function not finding interruptions

查看:158
本文介绍了船运动功能不寻找中断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想写一个函数来检查黑王是否被白车检查。

  void rook_white(piece A) [])//执行WR检查BK 
{
cout<< 发现白嘴鸦;
int k_x; // BK'S x coordinate
int k_y; // BK的y坐标
bool check = false;
for(int x = 0; x <8; x ++)
{
for(int y = 0; y <8; y ++)
{
if A [t_i] .field [m_x-x] [m_y] =='k')//左移
{
k_x = m_x;
k_y = m_y;
goto al_1;
}
}
}
for(int x = 0; x <8; x ++)
{
for(int y = 0; y < 8; y ++)
{
if(A [t_i] .field [m_x + x] [m_y] =='k')//右移
{
k_x = m_x;
k_y = m_y;
goto al_2;
}
}
}
for(int x = 0; x <8; x ++)
{
for(int y = 0; y < 8; y ++)
{
if(A [t_i] .field [m_x] [m_y-y] =='k')//向上移动
{
k_x = m_x;
k_y = m_y;
goto al_3;
}
}
}
for(int x = 0; x <8; x ++)
{
for(int y = 0; y < 8; y ++)
{
if(A [t_i] .field [m_x] [m_y + y] =='k')//向下移动
{
k_x = m_x;
k_y = m_y;
goto al_4;
}
}
}
al_1:
for(int x = 0; x {
for y = 0; y {
if(!A [t_i] .field [m_x-x] [m_y] =='*')// Checking left
{
goto loop_exit;
}
}
}
al_2:
for(int x = 0; x {
for y = 0; y {
if(!A [t_i] .field [m_x + x] [m_y] =='*')// Check Right
{
goto loop_exit;
}
}
}
al_3:
for(int x = 0; x {
for y = 0; y {
if(!A [t_i] .field [m_x] [m_y-y] =='*')// Checking Up
{
goto loop_exit;
}
}
}
al_4:
for(int x = 0; x {
for y = 0; y {
if(!A [t_i] .field [m_x] [m_y + y] =='*')//检查Down
{
goto loop_exit;
}
}
}
loop_exit:
check = false;
if(check == true)
{
ofstream fr(FVR,ios :: app);
fr<< Black is in check by rook<< t_i < endl;
}
}

函数搜索x上的王在哪里, y轴。然后转到一个特定的算法(al_1,al_2,...),在其中搜索是否在国王和车之间有任何东西。



输入文件是这样的:

  ******** 
*** k ** **
********
*** q ****
********
********
*** R ****
********

这不应该输出任何内容,而

  ******** 
*** k ****
********
********
********
***** ***
*** R ****
********

应输出Black is in check by rook。 (t_i是要检查的板的编号)



A [t_i]是一个结构体数组,结构体由char字段[8] [8] ]。



我使用一个结构体,因为有无限数量的板子我要检查。



k_x和k_y是国王坐标。
m_x和m_y是从发现块的搜索函数传输的全局变量



这里是程序本身的int main() / p>

  #include< iostream> 
#include< fstream> // chess
#include< cstdlib>
using namespace std; //程序检查CHESS CHEKS
const char FVD [] =5_input.txt; // ************************************************ **
const char FVR [] =5_output.txt; // P - 白棋子(WP)p - 黑棋子(BP)
// --- // R - 白车(WR)r - 黑车// B - white bishop(WB)b - black bishop(BB)
int m_i = 0; // max i // N - 白骑士(WN)n - 黑骑士(BN)
int m_x = 0; // // Q - white queen(WQ)q - black queen(BQ)
int m_y = 0; // // K - 白王(WK)k - 黑王(BK)
int t_i = 0; // // ********************************************** ****
struct piece
{
char字段[8] [8];
};
void read(piece A [])
{
ifstream fd(FVD);
int i = 0;
m_i = 0;
while(!fd.eof())
{
for(int x = 0; x <8; x ++)
{
for ; y <8; y ++)
{
fd> A [i] .field [x] [y];
}
}
fd.ignore();
i ++;
m_i = i;
}
fd.close();
}
/// -------------------------------------- --------黑王在检查------------------------------------- -------------------------
void rook_white(piece A [])// does WR check BK
{
cout<< 发现白嘴鸦;
int k_x; // BK'S x coordinate
int k_y; // BK的y坐标
bool check = false;
for(int x = 0; x <8; x ++)
{
for(int y = 0; y <8; y ++)
{
if A [t_i] .field [m_x-x] [m_y] =='k')//左移
{
k_x = m_x;
k_y = m_y;
goto al_1;
}
}
}
for(int x = 0; x <8; x ++)
{
for(int y = 0; y < 8; y ++)
{
if(A [t_i] .field [m_x + x] [m_y] =='k')//右移
{
k_x = m_x;
k_y = m_y;
goto al_2;
}
}
}
for(int x = 0; x <8; x ++)
{
for(int y = 0; y < 8; y ++)
{
if(A [t_i] .field [m_x] [m_y-y] =='k')//向上移动
{
k_x = m_x;
k_y = m_y;
goto al_3;
}
}
}
for(int x = 0; x <8; x ++)
{
for(int y = 0; y < 8; y ++)
{
if(A [t_i] .field [m_x] [m_y + y] =='k')//向下移动
{
k_x = m_x;
k_y = m_y;
goto al_4;
}
}
}
al_1:
for(int x = 0; x {
for y = 0; y {
if(!A [t_i] .field [m_x-x] [m_y] =='*')// Checking left
{
goto loop_exit;
}
}
}
al_2:
for(int x = 0; x {
for y = 0; y {
if(!A [t_i] .field [m_x + x] [m_y] =='*')// Check Right
{
goto loop_exit;
}
}
}
al_3:
for(int x = 0; x {
for y = 0; y {
if(!A [t_i] .field [m_x] [m_y-y] =='*')// Checking Up
{
goto loop_exit;
}
}
}
al_4:
for(int x = 0; x {
for y = 0; y {
if(!A [t_i] .field [m_x] [m_y + y] =='*')//检查Down
{
goto loop_exit;
}
}
}
loop_exit:
check = false;
if(check == true)
{
ofstream fr(FVR,ios :: app);
fr<< Black is in check by rook<< t_i < endl;
}
}
/// --------------------------------- --------搜索检查//调用函数---------------------------------- ----------
void search(piece A [])//搜索片段并调用与其相关的函数
{
for(int i = 0; i {
for(int x = 0; x <8; x ++)
{
for(int y = 0; y < y ++)
{
if(A [i] .field [x] [y] =='R')
{
t_i =
m_x = x;
m_y = y;
rook_white(A);
}

}
}
}
}
int main()
{
piece A [10 ];
remove(FVR); //在输入新数据之前清除输出,因为ios :: app
read(A);
search(A);
ofstream fr(FVR);
fr<< 完成;
return 0;
}


解决方案

通常不会 - 我会给你一个完整的往返这一个(因为我觉得)。






您开始使用一个 main(),它应该读取任意数量的字段(但实际上是在第11次崩溃),以及一个搜索()函数,旨在最终迭代通过所有可能的棋子...但你的程序失败的检查的第一块,白车。



你也开始用C,然后介绍顺势疗法剂量的C ++,实际上使事情比必要的困难。



所以让我们修剪这个。 首先,我们将向您的示例代码中添加最小。






< vector> 而不是二维数组。向量是C ++中最有用的东西之一,并且没有任何理由不再使用C风格的数组(除了C API兼容性之外)。

  #include< vector> 
#include< iostream>

typedef std :: vector< std :: vector& char> >领域;

字段现在是向量的别名 char 的向量。这基本上与二维数组相同(包括 [] [] 寻址),但它有一些优点,你很快就会看到。






您的 rook_white()(按照您的设计)需要字段,以及车的X和Y坐标。允许我稍微调整你的函数原型 - 我喜欢更具表现力的标识符名称

  void rook_white(Field const& field,unsigned rook_x,unsigned rook_y); 

搜索并删除 A [t_i]。,我们现在只处理那个字段。使用 rook_x m_y 搜索并替换 m_x rook_y 。不是太难。也替换:

  ofstream fr(FVR,ios :: app); 
fr<< Black is in check by rook<< t_i < endl;

有:

 code> std :: cout<< 黑色是由车检查endl; 

现在我们不用处理文件I / O。






现在,我们需要设置一个字段,但我们现在不需要从文件中读取它。您可以在实际检查工作后展开代码。

  int main()
{
字段字段(8,std :: vector< char>(8,'*'));

std :: vector< char>(8,'*')创建一个8 '8' chars的临时向量。 字段字段(8,/*...*/); 创建一个字段



现在让我们来放置你的作品。

  unsigned rook_x = 3; 
unsigned rook_y = 6;
字段[rook_x] [rook_y] ='R';

unsigned king_x = 3;
unsigned king_y = 1;
field [king_x] [king_y] ='k';

此时,我意识到您的示例代码中有X和Y坐标混合在 search() (在X = 6,Y = 3时报告车),但不会感到失望。这不是你的问题的根源。



我们现在有字段和坐标来调用你的函数。

  rook_white(field,rook_x,rook_y); 
return 0;
}

这种写一个 main code>不真正反映您的最终应用程序应该做什么,而是设置一个特定功能的测试,称为测试驱动程序。我们刚刚从您的示例中删除了超过50行的不必要的代码,消除了各种无关的潜在问题。






看看 rook_white(),我们吗?






因为我们现在有一个向量<载体, char> > 而不是dumb数组,我们可以做一些nifty:用 .at()替换 [] 。原因?如果 [] 的索引超出边界,它可能会或可能不会崩溃该程序。如果 .at()的索引超出边界,则抛出异常。



所以,虽然 .at()是(有点)慢,通常不在生产代码中使用,我推荐给初学者,因为它不允许错误隐藏。



在这一点上,你应该跳起眉毛,思考自己,他为什么建议这个?那么你应该看看你的循环,...

  for(int x = 0; x <8; x ++) b $ b {
for(int y = 0; y <8; y ++)
{
if(field [rook_x-x] [rook_y] =='k')
{
k_x = rook_x;
k_y = rook_y;
goto al_1;
}
}
}

您对您的字段有超出访问限制



rook_x / rook_y 是在字段中间的某个地方,但你坚持访问任何 [rook_x - 7] [rook_y] if你找不到国王。这是原始代码中的负指数。因为我把坐标改为 unsigned (它溢出并变成真的很大),你会得到一个segfault崩溃(如果你幸运的话) )。这实际上是无意的;我只是声明不能为负的无符号的东西。



但这就是为什么我建议使用向量<<> ' .at()方法:尽早失败,尽可能大声。 例外情况优于未定义的行为。






始终循环 x y 使用 内的两个变量 。这是很多浪费的时钟周期。这不会打破你的logik只是偶然...



在这一点,你可能想完全重新工作你的代码。






如果你在第一个循环中向左移动您 goto al_1



第一个循环是 x == 0 ,检查 [rook_x - 0] [rook_y] ...猜猜是什么,你发现白车是介入的因为在该字段中没有'*',所以跳转到 loop_exit ...






即使你不会犯这个错误,你会从这个循环中输入 al_2 ,检查白嘴鸦的所有其余路线 ...






即使不会发生这种情况,无论发生什么情况,都会遇到这种情况:

  loop_exit:
check = false;
if(check == true)
{
std :: cout< 黑色在由rook \\\
检查;
}

好吧, check == true 永远不会发生,对吗?






您的一个意见...


...我只是不明白[switch语句],不能真正包装我的头


我的建议?我完全明白你为什么要尽可能快地写真正的东西。教科书很无聊。但你真的应该花更多的时间围绕的基本概念。 C和C ++是使用试错法方法无法很好地学习的语言。有太多的事情可以而且会出错。



我们有



如果你尝试太大的东西(像一个国际象棋程序)在你真正掌握基础知识之前,你可能会遇到的任何问题的答案都会比舒适有点长,无论是写作(如果有人感觉像是这样),并让你消化。






请:



不要使用 goto ,除非你绝对肯定地知道你在做什么。


I am trying to write a function that checks if the black king is in check by the white rook. The problem occurs when I try to search if there are any pieces in between the rook and the king.

    void rook_white(piece A[])                                      // does WR check BK
{
    cout << "Found White Rook ";
    int k_x;                                                  // BK'S x coordinate
    int k_y;                                                  // BK's y coordinate
    bool check = false;
    for(int x=0; x<8; x++)
    {
        for(int y=0; y<8; y++)
        {
            if(A[t_i].field[m_x-x][m_y] == 'k')                 // Moving Left
            {
                k_x=m_x;
                k_y=m_y;
                goto al_1;
            }
        }
    }
    for(int x=0; x<8; x++)
    {
        for(int y=0; y<8; y++)
        {
            if(A[t_i].field[m_x+x][m_y] == 'k')                 // Moving Right
            {
                k_x=m_x;
                k_y=m_y;
                goto al_2;
            }
        }
    }
    for(int x=0; x<8; x++)
    {
        for(int y=0; y<8; y++)
        {
            if(A[t_i].field[m_x][m_y-y] == 'k')                 // Moving Up
            {
                k_x=m_x;
                k_y=m_y;
                goto al_3;
            }
        }
    }
    for(int x=0; x<8; x++)
    {
        for(int y=0; y<8; y++)
        {
            if(A[t_i].field[m_x][m_y+y] == 'k')                 // Moving Down
            {
                k_x=m_x;
                k_y=m_y;
                goto al_4;
            }
        }
    }
al_1:
    for(int x=0; x<k_x; x++)
    {
        for(int y=0; y<k_y; y++)
        {
            if(!A[t_i].field[m_x-x][m_y] == '*')                   // Checking left
            {
                goto loop_exit;
            }
        }
    }
al_2:
    for(int x=0; x<k_x; x++)
    {
        for(int y=0; y<k_y; y++)
        {
            if(!A[t_i].field[m_x+x][m_y] == '*')                    // Checking Right
            {
                goto loop_exit;
            }
        }
    }
al_3:
    for(int x=0; x<k_x; x++)
    {
        for(int y=0; y<k_y; y++)
        {
            if(!A[t_i].field[m_x][m_y-y] == '*')                    // Checking Up
            {
                goto loop_exit;
            }
        }
    }
al_4:
    for(int x=0; x<k_x; x++)
    {
        for(int y=0; y<k_y; y++)
        {
            if(!A[t_i].field[m_x][m_y+y] == '*')                    // Checking Down
            {
                goto loop_exit;
            }
        }
    }
loop_exit:
    check = false;
    if (check == true)
    {
        ofstream fr(FVR,ios::app);
        fr << "Black is in check by rook " << t_i << endl;
    }
}

The function searches where is the king on the x and y axis. It then goes to a specific algorithm (al_1, al_2, ...) in which it searches if there is anything in between the king and the rook.

The input file is something along the lines of this:

********
***k****
********
***q****
********
********
***R****
********

this shouldn't output nothing, while

********
***k****
********
********
********
********
***R****
********

should output "Black is in check by rook ". (t_i being the number of the board it is being examined on)

A[t_i] is a struct array, the struct pieces consists of char field[8][8].

I use a struct because there is an unlimited number of boards I have to examine.

k_x and k_y are the king coordinates. m_x and m_y are global variables that are transferred from the search function in which a piece is found

here is the program itself with the int main()

#include <iostream>
#include <fstream>                  // chess
#include <cstdlib>
using namespace std;                                                       // PROGRAM CHECKS FOR CHESS CHEKS
const char FVD[]="5_input.txt";                                 // **************************************************
const char FVR[]="5_output.txt";                                // P - white pawn   (WP)      p - black pawn     (BP)
//---                                                           // R - white rook   (WR)      r - black rook     (BR)
//---                                                           // B - white bishop (WB)      b - black bishop   (BB)
int m_i=0;          // max i                                    // N - white knight (WN)      n - black knight   (BN)
int m_x=0;          //                                          // Q - white queen  (WQ)      q - black queen    (BQ)
int m_y=0;          //                                          // K - white king   (WK)      k - black king     (BK)
int t_i=0;          //                                          // **************************************************
struct piece
{
    char field[8][8];
};
void read(piece A[])
{
    ifstream fd(FVD);
    int i=0;
    m_i=0;
    while(!fd.eof())
    {
        for(int x=0; x<8; x++)
        {
            for(int y=0; y<8; y++)
            {
                fd >> A[i].field[x][y];
            }
        }
        fd.ignore();
        i++;
        m_i=i;
    }
    fd.close();
}
///  ----------------------------------------------BLACK KING IS IN CHECK--------------------------------------------------------------
void rook_white(piece A[])                                      // does WR check BK
{
    cout << "Found White Rook ";
    int k_x;                                                  // BK'S x coordinate
    int k_y;                                                  // BK's y coordinate
    bool check = false;
    for(int x=0; x<8; x++)
    {
        for(int y=0; y<8; y++)
        {
            if(A[t_i].field[m_x-x][m_y] == 'k')                 // Moving Left
            {
                k_x=m_x;
                k_y=m_y;
                goto al_1;
            }
        }
    }
    for(int x=0; x<8; x++)
    {
        for(int y=0; y<8; y++)
        {
            if(A[t_i].field[m_x+x][m_y] == 'k')                 // Moving Right
            {
                k_x=m_x;
                k_y=m_y;
                goto al_2;
            }
        }
    }
    for(int x=0; x<8; x++)
    {
        for(int y=0; y<8; y++)
        {
            if(A[t_i].field[m_x][m_y-y] == 'k')                 // Moving Up
            {
                k_x=m_x;
                k_y=m_y;
                goto al_3;
            }
        }
    }
    for(int x=0; x<8; x++)
    {
        for(int y=0; y<8; y++)
        {
            if(A[t_i].field[m_x][m_y+y] == 'k')                 // Moving Down
            {
                k_x=m_x;
                k_y=m_y;
                goto al_4;
            }
        }
    }
al_1:
    for(int x=0; x<k_x; x++)
    {
        for(int y=0; y<k_y; y++)
        {
            if(!A[t_i].field[m_x-x][m_y] == '*')                   // Checking left
            {
                goto loop_exit;
            }
        }
    }
al_2:
    for(int x=0; x<k_x; x++)
    {
        for(int y=0; y<k_y; y++)
        {
            if(!A[t_i].field[m_x+x][m_y] == '*')                    // Checking Right
            {
                goto loop_exit;
            }
        }
    }
al_3:
    for(int x=0; x<k_x; x++)
    {
        for(int y=0; y<k_y; y++)
        {
            if(!A[t_i].field[m_x][m_y-y] == '*')                    // Checking Up
            {
                goto loop_exit;
            }
        }
    }
al_4:
    for(int x=0; x<k_x; x++)
    {
        for(int y=0; y<k_y; y++)
        {
            if(!A[t_i].field[m_x][m_y+y] == '*')                    // Checking Down
            {
                goto loop_exit;
            }
        }
    }
loop_exit:
    check = false;
    if (check == true)
    {
        ofstream fr(FVR,ios::app);
        fr << "Black is in check by rook " << t_i << endl;
    }
}
///-----------------------------------------SEARCHING FOR THE CHECKS // CALLING FUNCTIONS --------------------------------------------
void search(piece A[])                                               // searches for piece and calls a function related to it
{
    for(int i=0; i<m_i-1; i++)
    {
        for(int x=0; x<8; x++)
        {
            for(int y=0; y<8; y++)
            {
        if (A[i].field[x][y]=='R')
                {
                    t_i=i;
                    m_x=x;
                    m_y=y;
                    rook_white(A);
                }

            }
        }
    }
}
int main()
{
    piece A[10];
    remove(FVR);            // clears the output before inputting new data because of ios::app
    read(A);
    search(A);
    ofstream fr(FVR);
    fr << "Done";
    return 0;
}

解决方案

I'll do what I don't usually do -- I'll give you a full round-trip on this one (because I feel like it).


You started with a main() that should read an arbitrary number of fields (but actually crashes on the 11th), and a search() function that is intended to eventually iterate through all possible chess pieces... but your program fails on the check for the very first piece, the white rook.

You also started with C, and then introduced homeopathic doses of C++, actually making things more difficult than necessary.

So let's trim this down. First, we'll get the "minimal" into your example code.


Let's use <vector> instead of a two-dimensional array. Vectors are one of the most useful things in C++, and there is really next to no reason for using C-style arrays anymore (except perhaps for C API compatibility).

#include <vector>
#include <iostream>

typedef std::vector< std::vector< char > > Field;

Field is now an alias for a vector of vectors of chars. That's basically the same as a two-dimensional array (including the [][] addressing), but it has some advantages as you will soon see.


Your rook_white() (as you designed it) needs one field, and the rook's X and Y coordinates. Allow me to tweak your function prototype a bit -- I like more expressive identifier names.

void rook_white( Field const & field, unsigned rook_x, unsigned rook_y );

Search-and-delete A[t_i]., we only work on that one field for now. Search-and-replace m_x with rook_x and m_y with rook_y. Not too hard. Also replace:

        ofstream fr(FVR,ios::app);
        fr << "Black is in check by rook " << t_i << endl;

With:

        std::cout << "Black is in check by rook" endl;

For now we don't bother with file I/O.


Now, we need to set up a field, but we do not need to read it from file for now. You can expand your code once you got the actual check working.

int main()
{
    Field field( 8, std::vector< char >( 8, '*' ) );

std::vector< char >( 8, '*' ) creates a temporary vector of 8 '8' chars. Field field( 8, /*...*/ ); creates a Field consisting of 8 copies of that temporary vector.

Now let's place your pieces.

    unsigned rook_x = 3;
    unsigned rook_y = 6;
    field[rook_x][rook_y] = 'R';

    unsigned king_x = 3;
    unsigned king_y = 1;
    field[king_x][king_y] = 'k';

At this point I realized your example code got "X" and "Y" coordinates mixed up in search() (reporting the rook at X = 6, Y = 3), but nevermind. That's not the source of your problems.

We now have field and coordinates to call your function.

    rook_white( field, rook_x, rook_y );
    return 0;
}

This way of writing a main() that doesn't really reflect what your final application should do, but rather sets up a test for a specific functionality, is called a test driver. We just shaved over 50 lines of unnecessary code from your example, eliminating all sorts of unrelated potential problems.


Now, let's have a look at rook_white(), shall we?


Since we now have a vector< vector< char > > instead of a "dumb" array, we could do something nifty: Replace [] access with .at(). The reason? If the index to [] is out-of-bounds, it might or might not crash the program. If the index to .at() is out-of-bounds, it will throw an exception.

So,, while .at() is (a bit) slower and usually not used in production code, I recommend it for beginners because it does not allow errors to "hide".

At this point you should be arcing an eyebrow and think to yourself, "why is he suggesting this?". Then you should look at your loops, and...

for(int x=0; x<8; x++)
{
    for(int y=0; y<8; y++)
    {
        if(field[rook_x-x][rook_y] == 'k')
        {
            k_x=rook_x;
            k_y=rook_y;
            goto al_1;
        }
    }
}

Yes, exactly. You have out of bounds accesses to your field.

rook_x / rook_y is somewhere in the midst of the field, but you insist on accessing anything up to [rook_x - 7][rook_y] if you cannot find the king. That was a negative index in your original code. Since I changed the coordinates to unsigned (which instead overflows and becomes really large) you'll get a segfault crash instead (if you're lucky). That was actually unintentional; I just declare things that cannot be negative unsigned by habbit.

But that's why I suggested using vector<>'s .at() method while you're still learning: Fail as early and as loud as possible. An exception is better than undefined behaviour.


Besides, you do (in all those loops) always loop over x and y, but only use one of the two variables inside the loop. That's a lot of wasted clock cycles. That this doesn't break your logik is mere chance...

At this point you probably want to completely re-work your code. But wait, there is more.


If you "move left" in your first loop, and find the king there, you goto al_1. There you loop (again using only one of the two loop counters) to check for intervening pieces.

The first loop is x == 0, checking [rook_x - 0][rook_y]... well guess what, you find the white rook to be intervening there, since there is no '*' in that field, so you jump to loop_exit...


And even if you wouldn't have made that mistake, you would come out of that loop and enter al_2, checking all remaining directions for the rook as well...


And even if all that wouldn't happen, no matter what happens, you eventually run into this:

loop_exit:
    check = false;
    if (check == true)
    {
        std::cout << "Black is in check by rook \n";
    }

Well, that check == true is never going to happen, right?


At this point I quote one of your comments...

...I just don't understand [switch statements] and couldn't really wrap my head around on how to write them as switch.

My suggestion? I fully understand why you want to write "something real" as fast as possible. Textbooks are boring. But you really should spend some more time "wrapping your head around" basic concepts. C and C++ are languages that really don't work that well with "trial & error" approaches to learning them. There is simply too much that can, and will, go wrong.

We have a list of recommended textbooks, if the one you have isn't to your tastes.

And if you try too large things (like a chess program) before you really got the basics right, the answer to any questions you might have will end up being quite a bit longer than comfortable, both to write (if someone feels like it) and for you to digest.


And please:

Don't use goto unless you absolutely, positively, know what you're doing.

这篇关于船运动功能不寻找中断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆