Что за ошибка - не присвоено значение out параметру? - C#
Формулировка задачи:
Вот код:
/*
* Created by SharpDevelop.
* User: User
* Date: 12.04.2016
* Time: 12:27
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections.Generic;
namespace BattleShips
{
/// <summary>
/// Description of MyClass.
/// </summary>
///
public class Checker
{
}
public class Player
{
string name;
bool [,] _Field = new bool[12,12];
int [] ShipsMax = new int[] {1,1,1,1,2,2,2,3,3,4};
public Player(string name)
{
this.name = name;
Place(out _Field);
GameStart();
}
void GameStart()
{
}
void Place(out bool[,] Field)
{
Random ShipsPlaces = new Random();
for (int i=0;i<12;i++)
for (int j=0;j<12;j++)
{
if (ShipsPlaces.Next(0,1)==1)
Field[i,j] = true;
else Field[i,j] = false;
}
}
void Show()
{
int count = 0;
for (int i=0;i<12;i++)
for (int j =0;i<12;j++)
{
if (count==12)
{
count=0;
Console.WriteLine();
}
if (_Field[i,j] == true)
Console.Write(1);
else Console.Write(0);
count++;
}
}
}
}Решение задачи: «Что за ошибка - не присвоено значение out параметру?»
textual
Листинг программы
if (_Field[i,j] == true) Console.Write(1); else Console.Write(0); count++;