当前位置: 首页>>代码示例>>C#>>正文


C# Game.Solve方法代码示例

本文整理汇总了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());
    }
开发者ID:manofsteel76667,项目名称:CodeInGame,代码行数:15,代码来源:SuperComputer.cs

示例2: Play

 public static int Play(int playerCount, string puzzle)
 {
     var game = new Game(playerCount);
     game.Solve(puzzle);
     return game._visitedHouses.Count;
 }
开发者ID:adbre,项目名称:AdventOfCode,代码行数:6,代码来源:Day3.cs

示例3: CreateGame

 public void CreateGame()
 {
     game = new Game();
     game.Solve();
 }
开发者ID:wongivy,项目名称:FizzBuzzKata,代码行数:5,代码来源:FizzBuzzKataTests.cs

示例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());
        }
开发者ID:manofsteel76667,项目名称:CodeInGame,代码行数:16,代码来源:TheResistance.cs

示例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();
    }
开发者ID:manofsteel76667,项目名称:CodeInGame,代码行数:21,代码来源:TANNetwork.cs

示例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
    }
开发者ID:manofsteel76667,项目名称:CodeInGame,代码行数:19,代码来源:ThereIsNoSpoon2.cs


注:本文中的Game.Solve方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。