Exemple #1
0
        public static void Print(GridWithLetters dataGrid)
        {
            string log = string.Empty;

            for (int x = -1; x < dataGrid.Wight; x++)
            {
                if(x == -1)
                {
                    log += "--";
                    continue;
                }

                log += " " + x + "  ";
            }

            Debug.Log("   " + log);

            for (int y = 0; y < dataGrid.Height; y++)
            {
                log = string.Empty;

                for (int x = 0; x < dataGrid.Wight; x++)
                {
                    char charToPrint = dataGrid.GetLeterInPosition(x, y);

                    if (charToPrint == '\0')
                        charToPrint = '_';

                    log += "(" + charToPrint + ") ";
                }

                Debug.Log(y + ". " + log);
            }
        }
 public void SetLettersGrid(GridWithLetters letterGridData)
 {
     for (int y = 0; y < 12; y++)
     {
         for (int x = 0; x < 12; x++)
         {
             letterRows[y].SetLetterInPosition(x, letterGridData.GetLeterInPosition(x, y));
         }
     }
 }
        public static bool Check(GridWithLetters dataGrid)
        {
            for (int y = 0; y < dataGrid.Height; y++)
            {
                for (int x = 0; x < dataGrid.Wight; x++)
                {
                    if (dataGrid.GetLeterInPosition(x, y) == '\0')
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }