Code:
procedure Addition;
begin
NextQuestions('Addition');
CarryOn;
Ready;
MakeQuestions(10, 50, 10, 50, 'a');
if ReadLn(IntToStr(I + 1) + '. What is ' + IntToStr(X[0]) + ' + ' + IntToStr(X[1]) + '?') = IntToStr(T) then
begin
Inc(C);
Answer(A, '');
end else
begin
Inc(W);
Answer(B, IntToStr(T));
Wait(2500);
end;
ClearDebug;
Wait(1000);
MakeQuestions(10, 50, 10, 50, 'a');
if ReadLn(IntToStr(I + 1) + '. What is ' + IntToStr(X[0]) + ' + ' + IntToStr(X[1]) + '?') = IntToStr(T) then
begin
Inc(C);
Answer(A, '');
end else
begin
Inc(W);
Answer(B, IntToStr(T));
Wait(2500);
end;
ClearDebug;
Wait(1000);
MakeQuestions(10, 50, 10, 50, 'a');
if ReadLn(IntToStr(I + 1) + '. What is ' + IntToStr(X[0]) + ' + ' + IntToStr(X[1]) + '?') = IntToStr(T) then
begin
Inc(C);
Answer(A, '');
end else
begin
Inc(W);
Answer(B, IntToStr(T));
Wait(2500);
end;
ClearDebug;
Wait(1000);
MakeQuestions(10, 50, 10, 50, 'a');
if ReadLn(IntToStr(I + 1) + '. What is ' + IntToStr(X[0]) + ' + ' + IntToStr(X[1]) + '?') = IntToStr(T) then
begin
Inc(C);
Answer(A, '');
end else
begin
Inc(W);
Answer(B, IntToStr(T));
Wait(2500);
end;
ClearDebug;
Wait(1000);
MakeQuestions(10, 50, 10, 50, 'a');
if ReadLn(IntToStr(I + 1) + '. What is ' + IntToStr(X[0]) + ' + ' + IntToStr(X[1]) + '?') = IntToStr(T) then
begin
Inc(C);
Answer(A, '');
end else
begin
Inc(W);
Answer(B, IntToStr(T));
Wait(2500);
end;
ClearDebug;
Wait(1000);
WriteLn('Here are your results so far:');
DisplayRW(True);
IncEx(Waited, 26500);
end;
Code:
procedure Addition;
begin
NextQ('Addition');
for QAI:= 0 to 4 do
begin
MakeQuestions(10, 50, 10, 50, '+');
DoQuestions('+');
end;
CurResults;
end;