TBLMULT.PAS 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. Uses Crt;
  2. Var
  3. i,j,Top,Bottom,Left,Right :byte;
  4. const
  5. f : array [1..7] of Real =
  6. (130.8, 146.8, 164.8, 174.6, 196.0, 220.0, 246.9);
  7. {-----------------------------------------------------------}
  8. Procedure Nota(a:real);
  9. Begin
  10. sound(Round(a));
  11. delay(300);
  12. Nosound
  13. End;
  14. {-----------------------------------------------------------}
  15. Procedure PlayMus;
  16. Begin
  17. nota(f[1]);
  18. nota(f[3]);
  19. nota(f[5]);
  20. nota(f[5]);
  21. nota(f[3]);
  22. nota(f[5]);
  23. nota(f[3]);
  24. nota(f[5]);
  25. nota(f[1]);
  26. nota(f[3]);
  27. nota(f[1]);
  28. nota(f[3]);
  29. nota(f[5]);
  30. nota(f[5]);
  31. nota(f[4]);
  32. nota(f[5]);
  33. nota(f[4]);
  34. nota(f[5]);
  35. nota(f[7]);
  36. nota(f[4]);
  37. nota(f[1]);
  38. nota(f[3]);
  39. nota(f[5]);
  40. nota(f[5]);
  41. nota(f[3]);
  42. nota(f[5]);
  43. nota(f[3]);
  44. nota(f[5]);
  45. nota(f[1]);
  46. nota(f[3]);
  47. nota(f[1]);
  48. nota(f[3]);
  49. nota(f[1]);
  50. nota(f[1]);
  51. nota(f[3]);
  52. nota(f[5]);
  53. nota(f[3]);
  54. nota(f[4]);
  55. nota(f[4]);
  56. nota(f[5]);
  57. nota(f[7]);
  58. nota(f[4]);
  59. nota(f[7]);
  60. nota(f[4]);
  61. nota(f[7]);
  62. nota(f[7]);
  63. nota(f[2]);
  64. nota(f[6]);
  65. nota(f[6]);
  66. nota(f[4]);
  67. nota(f[6]);
  68. nota(f[4]);
  69. nota(f[6]);
  70. nota(f[7]);
  71. nota(f[4]);
  72. End;
  73. Procedure DrawTable(l,r,t,b:byte);
  74. Var a : byte;
  75. Const
  76. lg = LightGray;
  77. Begin
  78. TextColor(cyan);
  79. GotoXY(32,2);
  80. Write('’ ¡«¨æ  㬭®¦¥­¨ï ');
  81. TextColor(LightMagenta);
  82. For a := 39-((abs(l-r)+1)*2) to (abs(l-r) +1)*4 + (38 - (abs(l-r) * 2)) do
  83. Begin
  84. GotoXY(a, 14 - (abs(t-b)+1) div 2 );
  85. Write('Í');
  86. GotoXY(a, (15-(abs(t-b)+1) div 2 ) + (abs(t-b)+1));
  87. Write('Í');
  88. end;
  89. Write('¼');
  90. GotoXY(WhereX-1, WhereY - 1 - (abs(t-b)+1));
  91. Write('»');
  92. TextColor(green);
  93. For a := l to r do
  94. begin
  95. GotoXY(37-((abs(l-r)+1)*2) + (a-l+1) * 4, 13 - (abs(t-b)+1) div 2);
  96. Write(a);
  97. end;
  98. For a := t to b do
  99. Begin
  100. GotoXY(36-(abs(l-r)+1)*2, (14 - (abs(t-b)+1) div 2 ) + a-t+1);
  101. If a < 10 then
  102. Begin
  103. TextColor(green);
  104. Write (a);
  105. TextColor(13);
  106. Write(' º');
  107. end
  108. else begin
  109. TextColor(green);
  110. Write(a);
  111. TextColor(13);
  112. Write(' º');
  113. end;
  114. GotoXY(WhereX-1, WhereY+1);
  115. Write('È');
  116. GotoXY((41-(abs(l-r)+1)*2) + (abs(l-r)+1)*4,
  117. (14 - (abs(t-b)+1) div 2) + a - t +1);
  118. Write('º');
  119. end;
  120. GotoXY(39-((abs(l-r)+1)*2), 14 - (abs(t-b)+1) div 2);
  121. Write('É')
  122. end; {DrawTable}
  123. {----------------------------------------------------------}
  124. Begin
  125. Clrscr;
  126. TextMode(CO80);
  127. TextColor(LightGray);
  128. Writeln('‚¢¥¤¨â¥ ç¨á«  ¤® ª®â®àëå áâநâì â ¡«¨æã, à §­¨æ  ¬¥¦¤ã ª®â®à묨 ');
  129. Writeln('¬¥­ìè¥ 18 ¨ ¯à®¨§¢¥¤¥­¨¥ ­ ¨¡®«ìè¨å ç¨á¥« ¬¥­ìè¥ 1000 ');
  130. Write('¢ ä®à¬ â¥: «¥¢®¥ ¯à ¢®¥ ¢¥àå­¥¥ ­¨¦­¥¥ (1 10 2 15): ');
  131. Read(Left, Right, Top , Bottom);
  132. While (abs(left-right) > 17) or (abs(top-bottom) > 17) or
  133. (right*bottom > 1000) do
  134. begin
  135. Write('�®¯à®¡ã©â¥ á­®¢  ');
  136. Read(Left, Right, Top , Bottom);
  137. end;
  138. Clrscr;
  139. DrawTable(Left, Right, Top , Bottom);
  140. TextColor(yellow);
  141. For i := top to bottom do
  142. begin
  143. for j := left to right do
  144. begin
  145. GotoXY((37-(abs(left-right)+1)*2) + (J-left+1) * 4,
  146. (14 - (abs(top-bottom)+1) div 2) + i-top+1);
  147. Write(I*J);
  148. end;
  149. end;
  150. GotoXY(30,24);
  151. TextColor(Black);
  152. TextBackGround(Black);
  153. PlayMus;
  154. TextColor(red);
  155. Write('... Press any key ... ');
  156. TextColor(lightgray);
  157. ReadKey
  158. End.