Instruction
1
Start work on a program with the title and specify the list of used plugins:

program reshiprimer;
uses crt;
2
Specify to the compiler what the program will include the variables:

var
a,b,c:integer;
d:string;

Here a and b - terms, c - amount, d - the answer to the question of whether the user wants to play again.
3
Mark the beginning of the program and infinite loop, and initialize the random number generator:

begin
randomize;
while 0=0 do
begin
4
Program generate two random numbers in the range 0 to 1000:

a:=round(random(1000));
b:=round(random(1000));
5
Show the user an example that it needs to solve, and then query the result:

writeln('How will'),a,('+'),b,('?');
phony(c);
6
Inform the user, whether he decided example:

if a+b=c then writeln('Correct!') else writeln('Wrong!);
7
Ask the user whether they want to play again:

writeln('Going to play next?');
phony(d);
8
If the answer quit program:

if upcase(d)'Y' then halt(0);
9
Complete first cycle and then the program itself:

end
end.

Note the point after the second end statement.
10
Run the program by pressing Ctrl+F9. The screen will display the first example. Count in mind and enter the answer. The machine will tell you that it has been correctly solved. Will then be asked if you wish to continue playing. The answer is Y or Y will cause the output of the following example, and enter any other letter to exit.
11
Achieving proper operation of the game, proceed to its improvement. For example, add the clear screen before showing each new example the command cls. Using the procedure textcolor, make labels to be displayed in different colors. Think about how you can make the program automatically change the complexity of the examples with the right answers to difficult and improper to simplify. To diversify the game, add the function generating examples for various math operations.