home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 31
/
CDASC_31_1996_juillet_aout.iso
/
vrac
/
cddk9605.zip
/
TUTOR.ARJ
/
TUTOR5.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1996-05-16
|
1KB
|
63 lines
PROGRAM Tutor5;
{$A+,B-,F+,I-,Q-,R-,S-,X+}
USES
Concerto, IO, Scripts, Types, xStrings;
{ This version is nearly identical to TUTOR3.PAS, except that the prompts
are now stored as typed constants. This allows you to easily change
them if needed. }
CONST
Prompt : pChar40 = 'And on this day, he spoke: ';
TooHigh : pChar80 = 'Your eyes are toward the heavens, esteemed one.~|';
TooLow : pChar80 = 'Your feet forever touch the earth, O Great One!~|';
Winner : pChar80 = 'You have ascended to the heavens!~|';
VAR
Entry : pChar3;
Number : Byte;
BEGIN
RegisterConcerto;
Script('Init');
{} SO_ClrScr;
{ Select a random number }
Number:=Random(100)+1;
REPEAT
{ The next section is described in TUTOR3.PAS }
SO_pChar(Prompt);
Entry[0]:=#0;
SI_pChar(Entry,3);
{} SO_CRLF;
{ Check the answer... }
IF p_Int(Entry)=Number THEN
BEGIN
SO_pCharLn(Winner);
ExitDoor(0);
END
ELSE
IF p_Int(Entry)>Number THEN
SO_pCharLn(TooHigh)
ELSE
SO_pCharLn(TooLow);
UNTIL False;
END.