📄 wordgame.h
字号:
#ifndef _WORDGAME_H
#define _WORDGAME_H
#include <string>
using namespace std;
#include "point.h"
#include "tvector.h"
#include "linkset.h"
class WordGame
{
public:
WordGame(int size); // max grid size
void MakeBoard(); // create a grid of letters
// is a word on the board? one version returns locations
bool OnBoard(const string& s);
bool OnBoard(const string& s, tvector<Point>& locations);
// other functions
private:
typedef LinkSet<Point> PointSet;
typedef LinkSetIterator<Point> PointSetIterator;
tmatrix<char> myBoard;
tvector<PointSet> myLetterLocs;
PointSet myVisited;
bool IsAdjacent(const Point& p, const Point& q);
bool OnBoardAt(const string& s, const Point& p,
tvector<Point>& locs);
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -