If you want to learn how computers "think" then lisp or clisp is your best bet. For pascal, an example with footnotes:
program learn; {this program generates random problems}
uses crt; {this is put here to unlock 3 new funtions}
var a,b,c,d,e,f,right: integer; {this is the variable section}
label 1,2,3,4,5; {this is the label declaration section}
begin {this starts the program}
textbackground(green);{this makes the screen green}
textcolor(white);
clrscr;
repeat {
inc(f); { these create a new random set
until f=100000;{
randomize; {}
1:
b:=random(20)+1;
c:=random(20)+1;
d:=c+b; {this adds}
writeln(b,' + ',c,' ='); {this spits out data}
writeln;
readln(a);
if a=d then
begin
inc(right);
writeln('HORRAY! YOU GOT IT RIGHT! you have ',right,' points!');
end
else
begin
right:=right-1;
writeln('WRONG! you have ',right,' points');
end;
goto 1;
end.