/* Word Finder Finds words (based on a word list) in an array of letters, or from an anagram Copyright (C) 2002-2007 Dmitry Brant http://dmitrybrant.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ //--------------------------------------------------------------------------- #ifndef Unit1H #define Unit1H //--------------------------------------------------------------------------- #include #include #include #include #include //--------------------------------------------------------------------------- typedef struct tagWordRec{ char* word; int length; bool found; }myWordRec; //--------------------------- struct NodeRec{ char letter; bool taken; struct NodeRec* adjacent[32]; }; //--------------------------------- class TForm1 : public TForm { __published: // IDE-managed Components TListBox *lstResults; TButton *cmdGo; TEdit *txtMinLen; TLabel *Label1; TGroupBox *GroupBox1; TEdit *txt11; TEdit *txt12; TEdit *txt13; TEdit *txt14; TEdit *txt21; TEdit *txt22; TEdit *txt23; TEdit *txt24; TEdit *txt15; TEdit *txt25; TEdit *txt16; TEdit *txt26; TEdit *txt17; TEdit *txt27; TEdit *txt18; TEdit *txt28; TEdit *txt38; TEdit *txt37; TEdit *txt36; TEdit *txt35; TEdit *txt34; TEdit *txt33; TEdit *txt32; TEdit *txt31; TEdit *txt41; TEdit *txt51; TEdit *txt61; TEdit *txt71; TEdit *txt81; TEdit *txt82; TEdit *txt83; TEdit *txt84; TEdit *txt85; TEdit *txt86; TEdit *txt87; TEdit *txt88; TEdit *txt78; TEdit *txt68; TEdit *txt58; TEdit *txt48; TEdit *txt47; TEdit *txt57; TEdit *txt67; TEdit *txt77; TEdit *txt76; TEdit *txt75; TEdit *txt65; TEdit *txt66; TEdit *txt56; TEdit *txt55; TEdit *txt46; TEdit *txt45; TEdit *txt44; TEdit *txt43; TEdit *txt42; TEdit *txt52; TEdit *txt53; TEdit *txt54; TEdit *txt64; TEdit *txt63; TEdit *txt62; TEdit *txt72; TEdit *txt73; TEdit *txt74; TGroupBox *GroupBox2; TEdit *txtAnagram; TButton *cmdAnagram; void __fastcall FormClose(TObject *Sender, TCloseAction &Action); void __fastcall cmdGoClick(TObject *Sender); void __fastcall txtKeyPress(TObject *Sender, char &Key); void __fastcall cmdAnagramClick(TObject *Sender); void __fastcall txtAnagramKeyPress(TObject *Sender, char &Key); void __fastcall txtMinLenKeyPress(TObject *Sender, char &Key); private: // User declarations myWordRec* words; int wordCount, minLength; NodeRec Nodes[8][8]; void SearchNode(NodeRec* Node, int* matchList, int numMatches); char searchString[16]; int searchStringLen; public: // User declarations __fastcall TForm1(TComponent* Owner); }; //--------------------------------------------------------------------------- extern PACKAGE TForm1 *Form1; //--------------------------------------------------------------------------- #endif