open-source-search-engine/TuringTest.h

31 lines
649 B
C
Raw Normal View History

2013-08-03 00:12:24 +04:00
#ifndef _TURINGTEST_H_
#define _TURINGTEST_H_
#include "gb-include.h"
#include "TcpServer.h"
#include "HashTable.h"
class TuringTest {
public:
TuringTest();
~TuringTest();
2014-11-11 01:45:11 +03:00
static const int32_t TMAX_HEIGHT = 19;
static const int32_t TMAX_WIDTH = 15;
static const int32_t MASK = 4095;
2013-08-03 00:12:24 +04:00
// 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;
2014-11-11 01:45:11 +03:00
int32_t m_nextQuestion;
2013-08-03 00:12:24 +04:00
char m_buf[26][TMAX_HEIGHT][TMAX_WIDTH];
};
extern TuringTest g_turingTest;
#endif