Beispiel #1
0
        private static void Main(string[] args)
        {
            random_ = new Random();
            var wall  = new List <int>(Enumerable.Range(0, 136));
            var count = wall.Count;

            for (var i = 0; i < count; i++)
            {
                var r = random_.Next(i, count);
                (wall[i], wall[r]) = (wall[r], wall[i]);
            }
            var hand     = new TileIds(wall.GetRange(0, 13));
            var discards = new List <int>();

            wall.RemoveRange(0, 13);

            for (var c = wall.Count; c > 0; c--)
            {
                hand.Add(wall[0]);
                wall.RemoveAt(0);

                PrintTiles(hand);

                var res = HandCalculator.EstimateHandValue(hand, hand.Last() /*, config:new HandConfig(isTsumo:true)*/);
                if (res.Error is null)
                {
                    Console.WriteLine("");
                    PrintHandResult(hand, hand.Last(), null, res);
                    break;
                }
                discards.Add(DecideDahai(hand));

                PrintTiles(hand);
            }
        }