Помогите, пожалуйста
Uses Crt;
procedure Menu;
begin
clrscr();
TextColor(LightGreen);
WriteLn;
WriteLn(' УГАДАЙ ЧИСЛО');
WriteLn;
WriteLn('Сыграем?');
WriteLn(' y: Старт');
WriteLn;
WriteLn(' n: Выход');
WriteLn( #10#13, #10#13, #10#13, #10#13, #10#13);
WriteLn(' Выбор: ');
end;
procedure victory(j:byte);
begin
writeln('Поздравляем Вы победили за', j ,'попыток');
readln;
read;
end;
procedure looser (RandInt:byte);
begin
writeln('Вы проиграли...');
writeln('Загаданное число:' , RandInt );
readln;
read;
end;
procedure BeginGame;
var
RandInt, UserInt, j: byte;
const
MaxInt: byte =100;
MaxJ: byte =10;
begin
TextColor(LightGreen);
RandInt:=random(MaxInt);
for j:=1 to MaxJ do begin
WriteLn(' Введите число');
ReadLn(UserInt);
case byte((UserInt - RandInt) > 0) + 2 * byte((UserInt - RandInt) < 0) of
0: begin victory(j); exit end;
1: writeln('Загаданное число меньше введеного');
2: writeln('Загаданное число больше введеного');
end;
end;
menu;
end;
procedure EndGame;
begin
TextColor(LightRed);
WriteLn(' ПРИХОДИТЕ ЕЩЕ...');
end;
function Choice:boolean;
var
ch: char;
begin
ch:='q';
while (ch<>'y') or (ch<>'n') do begin
ch := ReadKey;
case ch of
'y':Choice:=true;
'n':Choice:=false;
end;
end;
end;
begin
Menu;
if Choice =true then BeginGame
else EndGame;
end.
ЗЫ -- компилятор FP.
Сообщение отредактировано: compiler -