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 >
Pascal/Delphi Source File  |  1996-05-16  |  1KB  |  63 lines

  1.  
  2. PROGRAM Tutor5;
  3.  
  4. {$A+,B-,F+,I-,Q-,R-,S-,X+}
  5.  
  6. USES
  7.   Concerto, IO, Scripts, Types, xStrings;
  8.  
  9. { This version is nearly identical to TUTOR3.PAS, except that the prompts
  10.   are now stored as typed constants.  This allows you to easily change
  11.   them if needed.  }
  12.  
  13. CONST
  14.   Prompt  : pChar40 = 'And on this day, he spoke: ';
  15.   TooHigh : pChar80 = 'Your eyes are toward the heavens, esteemed one.~|';
  16.   TooLow  : pChar80 = 'Your feet forever touch the earth, O Great One!~|';
  17.   Winner  : pChar80 = 'You have ascended to the heavens!~|';
  18.  
  19.  
  20. VAR
  21.   Entry  : pChar3;
  22.   Number : Byte;
  23.  
  24.  
  25. BEGIN
  26. RegisterConcerto;
  27. Script('Init');
  28.  
  29. {} SO_ClrScr;
  30.  
  31.  
  32. { Select a random number }
  33.  
  34. Number:=Random(100)+1;
  35.  
  36. REPEAT
  37.  
  38.   { The next section is described in TUTOR3.PAS }
  39.  
  40.   SO_pChar(Prompt);
  41.   Entry[0]:=#0;
  42.   SI_pChar(Entry,3);
  43.  
  44.  
  45.   {} SO_CRLF;
  46.  
  47.  
  48.   { Check the answer... }
  49.  
  50.   IF p_Int(Entry)=Number THEN
  51.     BEGIN
  52.     SO_pCharLn(Winner);
  53.     ExitDoor(0);
  54.     END
  55.   ELSE
  56.     IF p_Int(Entry)>Number THEN
  57.       SO_pCharLn(TooHigh)
  58.     ELSE
  59.       SO_pCharLn(TooLow);
  60.  
  61. UNTIL False;
  62. END.
  63.