예제 #1
0
        private void Btn_OpenGrid_Click(object sender, EventArgs e)
        {
            var op = new OpenFileDialog();

            op.Filter = "avlsdk files (*.avlsdk)|*.avlsdk";
            op.ShowDialog();
            if (File.Exists(op.FileName))
            {
                new SudokuForm(SudokuFileReader.ReadGridCode(File.ReadAllText(op.FileName)), op.FileName).Show();
            }
        }
예제 #2
0
 private static void Main(string[] arguments)
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     if (arguments.Length > 0)
     {
         var path = arguments[0];
         Application.Run(new SudokuForm(SudokuFileReader.LoadGridFromFile(path), path));
     }
     else
     {
         Application.Run(new SudokuMenu());
     }
 }
예제 #3
0
        private void startGame()
        {
            ISharedPreferences sPref = PreferenceManager.GetDefaultSharedPreferences(this);
            string             diff  = sPref.GetString("difficultyPref", "");
            Stream             ist   = null;

            if (diff.Equals("Medium"))
            {
                ist = Resources.OpenRawResource(Resource.Raw.medium);
            }
            else if (diff.Equals("Hard"))
            {
                ist = Resources.OpenRawResource(Resource.Raw.hard);
            }
            else
            {
                ist = Resources.OpenRawResource(Resource.Raw.easy);
            }
            GameController.getInstance().setInitial(SudokuFileReader.getRandSudoku(ist));
            GameController.getInstance().clean();
            FindViewById(Resource.Id.game_field).Invalidate();
        }