public Dictionary <string, bool> ResolveWords(PrefixTree dictionary, DieFace[] currentBoard) { int[,] nodes = { { 1, 2, 3, 4 }, { 5, 6, 7, 8 }, { 9, 0xA, 0xB, 0xC }, { 0xD, 0xE, 0xF, 0x10 } }; var letters = new char[4, 4]; int x = 0; int y = 0; foreach (var dieFace in currentBoard) { letters[x, y++] = dieFace.FaceCharacter[0]; if (y == 4) { y = 0; x++; } } wordList = new Dictionary <string, bool>(); dict = dictionary; graph = BuildGraph <char>(nodes, letters); foreach (var t in nodes) { AdjacencyNode node = graph.map[t]; node.Visted = 1; Debug.Assert(index == 0); word[index] = node.NodeContent; BuildCombinations(node, word); node.Visted = 0; word[index + 1] = (char)0; } return(wordList); }
// Constructor public MainPage() { InitializeComponent(); // PrefixTree takes a few seconds to create, so do it here dictionary = new PrefixTree(); dictionary.CreateDictionaryHash(); gb = new GameBoard(); gb.Roll(); }
// Constructor public MainPage() { InitializeComponent(); // PrefixTree takes a few seconds to create, so do it here dictionary = new PrefixTree(); dictionary.CreateDictionaryHash(); const bool runUnitTests = true; if (runUnitTests) { Content = UnitTestSystem.CreateTestPage(); IMobileTestPage imtp = Content as IMobileTestPage; if (imtp != null) { BackKeyPress += (x, xe) => xe.Cancel = imtp.NavigateBack(); } } }