コード例 #1
0
        public void GetActionTest(string data, string expectedAction)
        {
            var ai         = new Ai();
            var reader     = new StateReader(data);
            var initData   = reader.ReadInitData();
            var nextAction = ai.GetNextAction(reader.ReadState(initData), new Countdown(50)).ToString();

            Assert.That(nextAction, Is.EqualTo(expectedAction));
        }
コード例 #2
0
        private static void Main(string[] args)
        {
            var reader   = new StateReader();
            var initData = reader.ReadInitData();
            var ai       = new Ai();

            while (true)
            {
                var state     = reader.ReadState(initData);
                var countdown = new Countdown(45);
                var move      = ai.GetNextAction(state, countdown);
                Console.Error.WriteLine(countdown);
                Console.WriteLine(move);
            }
        }