parent
6f805a2b0a
commit
505ce88cf6
@ -1,37 +0,0 @@
|
||||
#ifndef QUESTION_GENERATOR_H_
|
||||
#define QUESTION_GENERATOR_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <random>
|
||||
|
||||
class QuestionGenerator {
|
||||
public:
|
||||
virtual ~QuestionGenerator() = default;
|
||||
|
||||
// 生成指定数量的数学题目
|
||||
virtual std::vector<std::string> GenerateQuestions(int count,
|
||||
const std::string& username) = 0;
|
||||
|
||||
// 检查题目是否符合难度要求
|
||||
virtual bool MeetsDifficultyRequirements(const std::string& question) = 0;
|
||||
|
||||
protected:
|
||||
QuestionGenerator();
|
||||
|
||||
// 生成指定范围内的随机数
|
||||
int GetRandomNumber(int min, int max);
|
||||
|
||||
// 从运算符列表中随机选择一个运算符
|
||||
char GetRandomOperator(const std::vector<char>& operators);
|
||||
|
||||
std::string current_user_;
|
||||
std::mt19937 rng_;
|
||||
|
||||
private:
|
||||
// 禁用拷贝构造和赋值操作
|
||||
QuestionGenerator(const QuestionGenerator&) = delete;
|
||||
QuestionGenerator& operator=(const QuestionGenerator&) = delete;
|
||||
};
|
||||
|
||||
#endif // QUESTION_GENERATOR_H_
|
||||
Loading…
Reference in new issue