本文整理汇总了C#中Game.Solve方法的典型用法代码示例。如果您正苦于以下问题:C# Game.Solve方法的具体用法?C# Game.Solve怎么用?C# Game.Solve使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Game
的用法示例。
在下文中一共展示了Game.Solve方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args) {
int N = int.Parse(Console.ReadLine());
Game game = new Game();
for (int i = 0; i < N; i++) {
string[] inputs = Console.ReadLine().Split(' ');
int J = int.Parse(inputs[0]);//Starting day
int D = int.Parse(inputs[1]);//Reservation length
game.AddReservation(new Reservation(J, D));
}
// Write an action using Console.WriteLine()
// To debug: Console.Error.WriteLine("Debug messages...");
Console.WriteLine(game.Solve());
}
示例2: Play
public static int Play(int playerCount, string puzzle)
{
var game = new Game(playerCount);
game.Solve(puzzle);
return game._visitedHouses.Count;
}
示例3: CreateGame
public void CreateGame()
{
game = new Game();
game.Solve();
}
示例4: Main
static void Main(string[] args) {
string L = Console.ReadLine();
int N = int.Parse(Console.ReadLine());
Game game = new Game(L);
Log.WriteLine("{0} characters, {1} words.", L.Length, N);
//Log.WriteLine(L);
for (int i = 0; i < N; i++) {
string W = Console.ReadLine();
game.Words.Add(new Word(W));
}
// Write an action using Console.WriteLine()
// To debug: Console.Error.WriteLine("Debug messages...");
Console.WriteLine(game.Solve());
}
示例5: Main
static void Main(string[] args) {
string startPoint = Console.ReadLine().Substring(9);
string endPoint = Console.ReadLine().Substring(9);
Console.Error.WriteLine(string.Format("{0} {1}", startPoint, endPoint));
Game game = new Game(startPoint, endPoint);
int N = int.Parse(Console.ReadLine());
//Console.Error.WriteLine(N + " stops.");
for (int i = 0; i < N; i++) {
game.AddStop(Console.ReadLine().Substring(9));
}
int M = int.Parse(Console.ReadLine());
//Console.Error.WriteLine(M + " routes.");
for (int i = 0; i < M; i++) {
game.AddRoute(Console.ReadLine());
}
// Write an action using Console.WriteLine()
// To debug: Console.Error.WriteLine("Debug messages...");
game.Solve();
}
示例6: Main
static void Main(string[] args) {
int width = int.Parse(Console.ReadLine()); // the number of cells on the X axis
int height = int.Parse(Console.ReadLine()); // the number of cells on the Y axis
Game game = new Game(width, height);
for (int i = 0; i < height; i++) {
string line = Console.ReadLine(); // width characters, each either 0 or .
for (int j = 0; j < line.Length; j++)
if (line[j] != '.') {
int links = int.Parse(line[j].ToString());
game.AddNode(j, i, links);
}
}
// Write an action using Console.WriteLine()
// To debug: Console.Error.WriteLine("Debug messages...");
game.BuildNeighbors();
game.Solve();
//Console.WriteLine("0 0 1 0 0 1"); // Three coordinates: a node, its right neighbor, its bottom neighbor
}