Example #1
0
        private static void WriteAllBoard(QuberMatrix matrix, string word, int offset = 0)
        {
            WriteHalfBoard(matrix, word, offset);

            matrix.WriteWordToRowBackwards(word, new Point(word.Length + offset - 1));
            matrix.WriteWordToColumnBackwards(word, new Point(word.Length + offset - 1));
        }
Example #2
0
        public static string To2DSimple(string word)
        {
            ValidateInput(word);

            var matrix = new QuberMatrix(word.Length);

            WriteHalfBoard(matrix, word);

            return(matrix.ToString());
        }
Example #3
0
        public static string To3D(string word)
        {
            ValidateInput(word);

            var matrix = new QuberMatrix(GetBoardBoundaryFor3D(word));
            var offset = GetWordLengthByTwo(word);

            WriteAllBoard(matrix, word);
            WriteAllBoard(matrix, word, offset);

            matrix.DrawIncrementingTimes('\\', new Point(1, 1), offset - 1);
            matrix.DrawIncrementingTimes('\\', new Point(1, word.Length), offset - 1);
            matrix.DrawIncrementingTimes('\\', new Point(word.Length, 1), offset - 1);
            matrix.DrawIncrementingTimes('\\', new Point(word.Length, word.Length), offset - 1);

            return(matrix.ToString());
        }
Example #4
0
 private static void WriteHalfBoard(QuberMatrix matrix, string word, int offset = 0)
 {
     matrix.WriteWordToRow(word, new Point(offset));
     matrix.WriteWordToColumn(word, new Point(offset));
 }