|
|
|
|
@ -10,7 +10,8 @@ public final class PrimaryQuestionGenerator implements QuestionGenerator {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String generateQuestion(Random random) {
|
|
|
|
|
int operandCount = random.nextInt(5) + 1;
|
|
|
|
|
// 至少生成两个操作数,避免题目退化成单个数字
|
|
|
|
|
int operandCount = random.nextInt(4) + 2;
|
|
|
|
|
StringBuilder builder = new StringBuilder();
|
|
|
|
|
for (int index = 0; index < operandCount; index++) {
|
|
|
|
|
if (index > 0) {
|
|
|
|
|
|