下面是我的战舰游戏代码.我一直收到以下错误:
由于StackOverflowException,进程终止..
它一直指向
char[,] Grid = new char[10, 10];
Run Code Online (Sandbox Code Playgroud)
怎么解决这个问题?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BattleShip_Jamshid_Berdimuratov
{
class BattleshipBoard
{
Player p = new Player();
public void Randomize()
{
p.SetGrid(1, 2);
p.SetGrid(2, 2);
p.SetGrid(3, 2);
}
public void DisplayBoard(char[,] Board)
{
int Row;
int Column;
Console.WriteLine(" ¦ 0 1 2 3 4 5 6 7 8 9");
Console.WriteLine("--+--------------------");
for (Row = 0; Row <= 9; Row++)
{
Console.Write((Row).ToString() + " ¦ ");
for (Column = 0; …Run Code Online (Sandbox Code Playgroud)