mirror of
https://github.com/gigablast/open-source-search-engine.git
synced 2024-10-05 04:37:39 +03:00
31 lines
637 B
C++
31 lines
637 B
C++
#ifndef _TURINGTEST_H_
|
|
#define _TURINGTEST_H_
|
|
|
|
#include "gb-include.h"
|
|
#include "TcpServer.h"
|
|
#include "HashTable.h"
|
|
|
|
class TuringTest {
|
|
public:
|
|
TuringTest();
|
|
~TuringTest();
|
|
static const long TMAX_HEIGHT = 19;
|
|
static const long TMAX_WIDTH = 15;
|
|
static const long MASK = 4095;
|
|
// turing test routines
|
|
|
|
//if they don't have permission, print the turing test
|
|
//otherwise don't print anything.
|
|
bool isHuman( HttpRequest *r);
|
|
bool printTest ( SafeBuf* sb );
|
|
|
|
protected:
|
|
HashTable m_answers;
|
|
bool m_tinit;
|
|
long m_nextQuestion;
|
|
char m_buf[26][TMAX_HEIGHT][TMAX_WIDTH];
|
|
};
|
|
|
|
extern TuringTest g_turingTest;
|
|
#endif
|