private void button2_Click(object sender, EventArgs e) { var ts = new List<List<Hai>>(); int times = 1000; for (int i = 0; i < times; i++) { var yama = new HaiYama(); yama.Syapai(); var t = yama.Haipai(); ts.Add(t); } var path = Path.Combine(Application.StartupPath + "testtehai1000.bin"); var fw = new FileStream(path, FileMode.Create); var bf = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); bf.Serialize(fw, ts); fw.Close(); }
private void timer1_Tick(object sender, EventArgs e) { timer1.Stop(); verifyCount--; if (verifyCount == 0) return; var yama = new HaiYama(); yama.Syapai(); var t = yama.Haipai(); //int scs = calcCSSyanten(t); var st = t.Select(x => x.ToString()).Aggregate("", (s1, s2) => s1 + s2); int scs = MajLibPairi.Pairi.Syanten(new MajLibPairi.TePai(st)); int sjs = calcJSSyanten(t); textBox1.Clear(); textBox1.AppendText(sjs.ToString()); textBox2.Clear(); textBox2.AppendText(scs.ToString()); if (scs == sjs) { textBox3.AppendText(string.Format("同じ({0}, {1})\n", sjs, scs)); } else { textBox3.AppendText(string.Format("結果が不一致({0}, {1})\n", sjs, scs)); return; } timer1.Start(); }