| | |
| Stránka: 1 z 1
| [ Príspevkov: 3 ] | |
Autor | Správa |
---|
Registrovaný: 28.12.10 Prihlásený: 02.02.11 Príspevky: 24 Témy: 4 |
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
_________________ PC // Intel Core 2 Duo E8200 2.67 GHz / 2GB RAM / NVIDIA GeFore 8800 GTX 512 MB
LAPTOP // 13.3" / Intel core i5 CPU M 460 2.53 GHz / 3,00 GB RAM DDR3 / Intel HD Graphics
CELL // Apple iPhone 4 |
|
Registrovaný: 11.08.07 Príspevky: 4088 Témy: 34 Bydlisko: Brno | Napísal Ďuri: 09.01.2011 10:35 | |
|
Kód: if guess < answer then writeln('Too Low!'); else if guess > answer then writeln('Too High!'); else writeln('You Guessed My Number In ', cnt, 'Guesses!'); Tu mas nadbytocne bodkociarky, medzi vetvami then a else nemozes pouzit bodkociarku. Zmaz ich z 2. a 4. riadku tejto casti kodu.
|
|
Registrovaný: 28.12.10 Prihlásený: 02.02.11 Príspevky: 24 Témy: 4 | Napísal autor témy Phelipe: 09.01.2011 13:16 | |
|
dakujem, uz to funguje
_________________ PC // Intel Core 2 Duo E8200 2.67 GHz / 2GB RAM / NVIDIA GeFore 8800 GTX 512 MB
LAPTOP // 13.3" / Intel core i5 CPU M 460 2.53 GHz / 3,00 GB RAM DDR3 / Intel HD Graphics
CELL // Apple iPhone 4 |
|
| Stránka: 1 z 1
| [ Príspevkov: 3 ] | |
Podobné témy | Témy | Odpovede | Zobrazenia | Posledný príspevok |
---|
| Real number v Assembler, C, C++, Pascal, Java | 3 | 446 | 06.02.2010 11:13 stopa27 | | [w8.1] Build number v Operačné systémy Microsoft | 3 | 308 | 20.09.2015 8:44 shiro | | Free Pascal a Turbo Pascal v Assembler, C, C++, Pascal, Java | 0 | 384 | 19.12.2014 13:18 Styracoz | | Display Number Of Private Messages v Redakčné systémy | 0 | 386 | 14.10.2006 14:48 JanoF | | Android - build number (vypnuty telefon) v Android, iOS, Windows Phone (Mobile) | 1 | 448 | 17.05.2017 10:45 hanesovic | | Win XP - ako zistit serial number v Operačné systémy Microsoft | 3 | 557 | 24.04.2014 23:13 4040 | | problem s XP update - Error number: 0x80244019 v Operačné systémy Microsoft | 1 | 637 | 04.10.2012 18:23 System32 | | Removes number of times a post is edited v Redakčné systémy | 0 | 722 | 13.10.2006 9:26 JanoF | | NOTICE: The number of disks is not adequate to create a raid v Pevné disky a radiče | 6 | 1387 | 01.08.2007 20:06 Morpheus | | pascal v Assembler, C, C++, Pascal, Java | 0 | 703 | 03.05.2009 12:35 ebb | | Pascal v Assembler, C, C++, Pascal, Java | 4 | 2062 | 01.03.2018 8:02 MTK | | pascal v Assembler, C, C++, Pascal, Java | 2 | 571 | 24.06.2010 20:17 KatjushaMan | | Pascal v Assembler, C, C++, Pascal, Java | 7 | 632 | 09.10.2011 21:30 F3RY | | pascal v Assembler, C, C++, Pascal, Java | 11 | 1288 | 07.04.2007 16:50 programator | | Pascal v Assembler, C, C++, Pascal, Java | 7 | 832 | 14.05.2011 20:04 F3RY | | pascal v Assembler, C, C++, Pascal, Java | 19 | 3059 | 30.04.2007 19:54 nikita |
| Nemôžete zakladať nové témy v tomto fóre Nemôžete odpovedať na témy v tomto fóre Nemôžete upravovať svoje príspevky v tomto fóre Nemôžete mazať svoje príspevky v tomto fóre
|
|