# HELP! puzzle~

Hi!I want to ask some questions;
1.where can I find the top 10 example or as if the top 10 example in this site?
2.I don't know why I can't accumulate the score ? I do the part like this;
begin
res[x,y]:=ch;
write(ch);
gotoxy(1,20);
writeln('Score: ',score);
if (ch='res=ans') then
nscore:=score +100;
if (ch<>'res=ans') then;
nscore:=score - 100;
nscore:=score+0;
gotoxy(1,20);
gotoxy(scrx,scry);
end;
CAn anyone help me?

• : Hi!I want to ask some questions;
: 1.where can I find the top 10 example or as if the top 10 example in this site?
: 2.I don't know why I can't accumulate the score ? I do the part like this;
: begin
: res[x,y]:=ch;
: write(ch);
: gotoxy(1,20);
: writeln('Score: ',score);
: if (ch='res=ans') then
: nscore:=score +100;
: if (ch<>'res=ans') then;
: nscore:=score - 100;
: nscore:=score+0;
: gotoxy(1,20);
: writeln('Your score : ', score);
: gotoxy(scrx,scry);
: end;
: CAn anyone help me?
:
Here is an example of a top 10 code using the bubble sort algorithm:
[code]
type
TPerson = record
Name: string;
Score: integer;
end;
TTopTen = array[1..10] of TPerson
var
TopTen: TTopTen;
Temp: TPerson;
i, j: integer;
begin
for i := 1 to 10 do
for j := 1 to 9 do
if TopTen[j].Score < TopTen[j+1].Score then
begin { jth person has lower score than j+1-th person, swap them }
Temp := TopTen[j];
TopTen[j] := TopTen[j+1];
TopTen[j+1] := Temp
end;
{ Display scores }
for i := 1 to 10 do
writeln(TopTen[i].Person, ' ',TopTen[i].Score);
end;
[/code]
If you want to add someone to the top ten, check if his score is higher than the 10th place and replace the 10th place with the new name and score.
This code can be easily changed to remove the records.

As for the accumulation code you posted, I cannot make heads or tails from it. So I cannot help you there.