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:
2009-11-16 23:36:38 +00:00
parent c62d48160a
commit 2ca44ec361
25 changed files with 509 additions and 193 deletions

43
core/rebus.h Executable file
View 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