winix/core/rebus.h

44 lines
572 B
C++
Executable File

/*
* 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