added: Rebus
(when no logged user wants to send a message then he is asked a question) git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@521 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
43
core/rebus.h
Executable file
43
core/rebus.h
Executable file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008-2009, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucorerebus
|
||||
#define headerfilecmslucorerebus
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
class Rebus
|
||||
{
|
||||
public:
|
||||
|
||||
struct Item
|
||||
{
|
||||
int key;
|
||||
std::string question;
|
||||
int answer;
|
||||
};
|
||||
|
||||
|
||||
void Init();
|
||||
Item * Rand();
|
||||
bool IsAnswerOk(Item * item, const std::string & answer);
|
||||
|
||||
private:
|
||||
|
||||
bool InitPair(int a, int b, Item & item);
|
||||
|
||||
std::vector<Item> table;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user