~~WAITPA.PAS 937 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. Program Wait;
  2. uses Crt;
  3. label 99;
  4. var i,j,k,X,Y,TA:integer; s:string[5];c,c1:char;
  5. begin
  6. Randomize;
  7. X:=WhereX; Y:=WhereY; TA:=TextAttr;
  8. s:=ParamStr(1);
  9. Val(s,i,j);
  10. s:=ParamStr(2);
  11. if s='' then j:=100 else Val(s,j,k);
  12. i:=i*j;
  13. i:=i-300;
  14. Window(1,1,80,25);
  15. GotoXY(20,25);
  16. TextAttr:=74;
  17. Write('Press any key to suspend execution or ESC to exit');
  18. for k:=1 to (i div 100) do begin
  19. Delay(100);
  20. if keypressed then
  21. begin
  22. GotoXY(20,25);
  23. write(' Press ENTER to continue or ESC to exit ');
  24. repeat
  25. c:=Readkey;
  26. if c=#0 then c1:=Readkey;
  27. until ((c=#27) or (c=#13));
  28. if c=#27 then halt(3);
  29. goto 99;
  30. end;
  31. end;
  32. if i>10000 then
  33. begin Sound(500);Delay(100);Nosound;Delay(2000);end;
  34. 99:
  35. GotoXY(X,Y);
  36. TextAttr:=TA;
  37. Sound(400+Random(600));
  38. Delay(100);
  39. Sound(400+Random(600));
  40. Delay(100);
  41. Sound(400+Random(600));
  42. Delay(100);
  43. Nosound;
  44. end.
  45.