private int DecideDahai() { var shantenList = new List <int>(); for (var i = 0; i < Hand.Count; i++) { var h = new TileIds(Hand); h.RemoveAt(i); shantenList.Add(Shanten.CalculateShanten(h)); } return(shantenList.IndexOf(shantenList.Min())); }
private static int DecideDahai(TileIds hand) { var shantenList = new List <int>(); for (var i = 0; i < hand.Count; i++) { var h = new TileIds(hand); h.RemoveAt(i); shantenList.Add(Shanten.CalculateShanten(h)); } shantenList.ForEach(Console.Write); Console.WriteLine(); var m = shantenList.IndexOf(shantenList.Min()); var t = hand[m]; hand.RemoveAt(m); return(t.Value); }