?? 棋盤.txt
字號:
using System;
class ChessBoard
{
public char[,] SquareColor=new char [8,8];
public ChessBoard()
{
for(int i=0;i<SquareColor.GetLength (0);i++)
{
for(int x=0;x<SquareColor.GetLength (1);x++)
{
if((x%2)==0)
if((i%2)==0)
SquareColor[i,x]='W';
else
SquareColor[i,x]='B';
else
if((i%2)==0)
SquareColor[i,x]='B';
else
SquareColor[i,x]='W';
}
}
}
void DrawBoard()
{
for(int i=0;i<SquareColor.GetLength (0);i++)
{
for(int x=0;x<SquareColor.GetLength (1);x++)
{
Console.Write (SquareColor[i,x]);
}
Console.WriteLine();
}
}
static void Main()
{
ChessBoard MyChessBoard=new ChessBoard ();
MyChessBoard.DrawBoard ();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -