using System.Collections.Generic;
public class EightQueenForTest
int[] QueenPosition = new int[_Max];
IList<IList<string>> result = new List<IList<string>>();
public IList<IList<string>> SolveStrat(int n)
public void PlaceQueen(int n)
for (int i = 0; i < _Max; i++)
private bool ConflictOrNot(int n)
for (int i = 0; i < n; i++)
if (QueenPosition[i] == QueenPosition[n] || Math.Abs(n - i) == Math.Abs(QueenPosition[n] - QueenPosition[i]))
List<string> solution = new List<string>();
for (int i = 0; i < _Max; i++)
StringBuilder output = new StringBuilder();
for (int j = 0; j < _Max; j++)
if (j == QueenPosition[i])
solution.Add(output.ToString());
public static void Main()
IList<IList<string>> result = new List<IList<string>>();
EightQueenForTest EightQueen = new EightQueenForTest();
result = EightQueen.SolveStrat(0);
foreach(var first in result)
Console.WriteLine("//Solution {0}", i++);
foreach(var second in first )
Console.WriteLine(second);