Kód:
uses
crt, sysutils,
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes
{ add your units here };
var
answer, guess, cnt:integer;
game:string;
begin
repeat
repeat
clrscr();
writeln('Please Select A Game');
writeln;
writeln('A) 10');
writeln('B) 100');
writeln('C) 1000');
write('Selection: ');
readln(game);
game := UpperCase(game);
randomize
until (game = 'A') or (game = 'B') or (game = 'C');
clrscr();
if game = 'A' then
begin
answer := random(10) + 1;
writeln('Game 1 - 10');
end
else if game = 'B' then
begin
answer := random(100) + 1;
writeln('Game 1 - 100');
end
else if game = 'C' then
begin
answer := random(1000) + 1;
writeln('Game 1 - 1000');
end;
cnt := 0;
repeat
write('Please Enter Your Guess');
readln(guess);
cnt := cnt + 1;
if guess < answer then
writeln('Too Low!');
else if guess > answer then
writeln('Too High!');
else
writeln('You Guessed My Number In ', cnt, 'Guesses!');
until guess = answer;
repeat
writeln;
writeln('Play Again? Y/N: ');
readln(game);
game := UpperCase(game);
until (game = 'Y') or (game = 'N');
until (game = 'N');
end.
zdravim, kto by cistou nahodou mal nervy stale mi vyhadzuje "fptut6guess.lpr(63,7) Fatal: Syntax error, "UNTIL" expected but "ELSE" found" pri predposlednom loope repeat - until ked to chcem spustit a odskusat ... isiel som podla navodu, ci som nevsimavy neviem ale neviem sa k tomu dopracovat