//public static List<Intdel> GetWeights = new List<Intdel> { }; //가중치 함수를 저장하는 델리게이트 리스트 ! //public static List<double>[] l = new List<double>[33]; private static double GetW(int num) { int i, j; double ret = 0; //TMap.RawPrint(); for (i = 0; i < GetWeights.Count; i++) { ret += l[num][i] * GetWeights[i](); } return(ret); }
private static void P2() { double TempWeight; //5.0 0.5 0.2 -8.0 -0.5 -0.5 default // GetWeights.Add(Weight.ClearLine); GetWeights.Add(Weight.AdjacentWall); GetWeights.Add(Weight.Adjacent); GetWeights.Add(Weight.BlockEmpty); GetWeights.Add(Weight.MaxHeight); GetWeights.Add(Weight.fourway); GetWeights.Add(Weight.threeway); GetWeights.Add(Weight.AttackLine); //GetWeights.Add(TWeight.AttackLine); //GetWeights.Add(TWeight.AdjacentWall); //GetWeights.Add(TWeight.Adjacent); //GetWeights.Add(TWeight.BlockEmpty); //GetWeights.Add(TWeight.EmptyBlock); //GetWeights.Add(TWeight.MaxHeight); //GetWeights.Add(TWeight.fourway); //GetWeights.Add(TWeight.threeway); int i, j, k, ii, jj, kk, tc, t, top = 0, flag = 0, godown, sel, si, sj, tom = 0; List <Point> ls = new List <Point>(); List <data> Rank = new List <data>(); StreamReader sr = new StreamReader(@"2PBEST.txt"); l[0] = new List <double>(); foreach (string s in sr.ReadLine().Split()) { try { // Console.WriteLine((double)Convert.ToDouble(s)); l[top].Add(Convert.ToDouble(s)); } catch (Exception e) { //Console.WriteLine(e); } } sr.Close(); Thread.Sleep(1700); while (!Map.IsDied()) { Map.Read(); Block.TRead(); PlayOneBlock2(0); //Map.Print(); //Map.cll(); Thread.Sleep(28); } }