Example #1
0
File: Program.cs Project: saihe/C-
        static void Main(string[] args)
        {
            Dice rm = new Dice();

            while (true)
            {
                //ナビ
                string s = Console.ReadLine();
                string msg = "";
                if (s == "h")
                {
                    /*
                    for (var j = 0; j < rm.his.Count; j++)
                    {
                        msg += "履歴" + string.Format("{0,4}", j) + ":" + rm.his[j] + "\n";
                        msg += "\n";
                    }
                    */
                    foreach (string key in rm.sum.Keys)
                    {
                        msg += key + ":" + rm.sum[key] + "\n";
                    }

                    foreach(string key in rm.perc.Keys)
                    {
                        msg += key + ":" + rm.perc[key].ToString("F2") + "%\n";
                    }
                    msg += "total:" + (rm.sum["1合計"] * 100) / rm.his.Count + "\n";
                    msg += "total:" + (rm.sum["2合計"] * 100) / rm.total + "\n";
                    msg += "total:" + (rm.sum["3合計"] * 100) / rm.total + "\n";
                    msg += "total:" + (rm.sum["4合計"] * 100) / rm.total + "\n";
                    msg += "total:" + (rm.sum["5合計"] * 100) / rm.total + "\n";
                    msg += "total:" + (rm.sum["6合計"] * 100) / rm.total + "\n";

                }
                else if (s == "")
                {
                    msg = "数字:" +  rm.getNum();
                    rm.total++;

                }
                Console.WriteLine(msg);

            }
        }
Example #2
0
File: Program.cs Project: saihe/C-
        static void Main(string[] args)
        {
            Dice rm = new Dice();

            while (true)
            {
                //ナビ
                Console.ReadLine();
                Console.WriteLine("ダイス1:" + rm.Dice1());
                Console.WriteLine("ダイス2:" + rm.Dice2());
                Console.WriteLine("ダイス3:" + rm.Dice3());
                Console.WriteLine(rm.Msg());
                Console.WriteLine("所持ポイント" + rm.pp);
                
                //result初期化
                for(var i = 0;i <= 6; i++)
                {
                    rm.result[i] = 0;
                }
            }
        }
Example #3
0
File: Program.cs Project: saihe/C-
        static void Main(string[] args)
        {
            Dice rm = new Dice();

            while (true)
            {
                //ナビ
                string s = Console.ReadLine();
                
                /*
                if (s == "h")
                {
                    for(var j = 0 ; j < rm.his.Count ; j++) {
                        Console.WriteLine("履歴" + string.Format("{0,4}" ,  j) + ":" + rm.his[j]);
                    }
                }else if (s == "")
                {
                    Console.WriteLine("数字:" + "{0}", rm.getNum());
                }
                */


                string msg = "";
                if (s == "h")
                {
                    for (var j = 0; j < rm.his.Count; j++)
                    {
                        msg += "履歴" + string.Format("{0,4}", j) + ":" + rm.his[j];
                        msg += "\n";

                    }
                }
                else if (s == "")
                {
                    msg = "数字:" +  rm.getNum();
                }
                Console.WriteLine(msg);

            }
        }