예제 #1
0
 public void Create10x10Game()
 {
     game = new Game(10, 10);
     Assert.That(game.Width, Is.EqualTo(10));
     Assert.That(game.Height, Is.EqualTo(10));
     game.Random();
 }
예제 #2
0
        static void Main(string[] args)
        {
            Console.Clear();

            var cancellationTokenSource = new CancellationTokenSource();
            var cancellationToken       = cancellationTokenSource.Token;

            Console.CursorVisible   = false;
            Console.ForegroundColor = ConsoleColor.Blue;

            _ = Game.Random(20).Run(cancellationToken);
            //_ = Game.Blinker().Run(cancellationToken);

            Console.WriteLine("Press any key to stop the game");

            while (!cancellationTokenSource.IsCancellationRequested)
            {
                Console.ReadKey();
                cancellationTokenSource.Cancel();
            }
        }
예제 #3
0
 public void Random()
 {
     game.Random();
 }