/* * wordentry.hpp * * Created on: Oct 18, 2010 * Author: mike * for use in Yale course CPSC 427a, Fall 2010 */ #pragma once #include #include "tools.hpp" #define MAXLEN 9 // maximum triangle size #define MINLEN 3 // minimum triangle size class Word { public: static const char* allowed_chars; static int triangle_max; static int triangle_min; static bool allowed_set[]; protected: const int len; char cword[MAXLEN + 1]; char profile[MAXLEN + 1]; void sort(); public: Word(const char* cword); ~Word() { } const int getLen() const { return len; } const char* getCword() const { return cword; } const char* getProfile() const { return profile; } bool operator<=(const Word& w2) const; static bool isAllowed(const char *cword); ostream& debugPrint(ostream& out) const; ostream& print(ostream& out) const; }; //------------------------------------------------------------------- inline ostream& operator<<(ostream& out, const Word& word) { return word.print(out); }