Ejemplo n.º 1
0
        private void Initialize()
        {
            // Define the size of the Game chart
            // and fill the data structure with input data

            initChart = new GameChart(gameSize, dataIn);
        }
Ejemplo n.º 2
0
        // -----------
        // Constructors
        // -----------

        // Copy constructor
        // This is USED
        public GameChart(GameChart c)
        {
            size   = c.size;
            dataIn = c.dataIn;
            chart  = new int[size, size];
            Array.Copy(c.chart, chart, size * size);
        }
Ejemplo n.º 3
0
 public void RetrievePreviousGame(Game backup)
 {
     hitsCollection = backup.hitsCollection.ToList();
     allNumbers     = backup.allNumbers.ToList();
     initChart      = backup.initChart;
     candidateNr    = backup.candidateNr;
     hitsNr         = backup.hitsNr;
 }
Ejemplo n.º 4
0
 private void Show(GameChart initChart)
 {
     // I must show per columns and NOT per row as when I scan an array
     Console.WriteLine("----------------------");
     for (int i = 0; i < gameSize; i++)
     {
         for (int j = 0; j < gameSize; j++)
         {
             Console.Write(initChart.GetElement(i, j) + " ");
             if (j == 2 || j == 5)
             {
                 Console.Write("| ");
             }
         }
         Console.WriteLine();
         if (i == 2 || i == 5 || i == 8)
         {
             Console.WriteLine("----------------------");
         }
     }
 }
Ejemplo n.º 5
0
 // Free the Backup List from on Chart
 //
 public void RemoveChartFromList(GameChart gchart)
 {
     chartList.Remove(gchart.chart);
 }
Ejemplo n.º 6
0
 //
 // save the char in the List chartList
 //
 public void SaveChartInList(GameChart gchart)
 {
     // save the
     chartList.Add(gchart.chart);
 }
Ejemplo n.º 7
0
 private void Show2(GameChart c)
 {
     Console.WriteLine("Output: " + initChart.ConvertToString());
 }