fork download
  1. program project1;
  2.  
  3. {$mode objfpc}{$H+}
  4. {$APPTYPE CONSOLE}
  5.  
  6. uses
  7. {$IFDEF WINDOWS}
  8. Windows, {for setconsoleoutputcp}
  9. {$ENDIF}
  10. Classes;
  11. const
  12. // ANSI table drawing chars
  13. tdTopLeft = #27'(0l'#27'(B'; // ┌
  14. tdTopCenter = #27'(0w'#27'(B'; // ┬
  15. tdTopRight = #27'(0k'#27'(B'; // ┐
  16. tdMidLeft = #27'(0t'#27'(B'; // ├
  17. tdMidCenter = #27'(0n'#27'(B'; // ┼
  18. tdMidRight = #27'(0u'#27'(B'; // ┤
  19. tdBottomLeft = #27'(0m'#27'(B'; // └
  20. tdBottomCenter = #27'(0v'#27'(B'; // ┴
  21. tdBottomRight = #27'(0j'#27'(B'; // ┘
  22. tdHorzLine = #27'(0q'#27'(B'; // ─
  23. tdVertLine = #27'(0x'#27'(B'; // │
  24. var
  25. i: byte;
  26. s: string;
  27. ch: Char;
  28. begin
  29. {$IFDEF WINDOWS}
  30. SetConsoleOutputCP(CP_UTF8);
  31. {$ENDIF}
  32.  
  33. // thanks wp, https://f...content-available-to-author-only...l.org/index.php/topic,36945.msg246843.html#msg246843
  34. WriteLn('┌──────────────────────┐');
  35. WriteLn('│ Text in a box │');
  36. WriteLn('╘══════════════════════╛');
  37. WriteLn;
  38. i := 0;
  39. for ch := #32 to #255 do begin
  40. Write(ch, ' ');
  41. inc(i);
  42. if i mod 16 = 0 then WriteLn;
  43. end;
  44. WriteLn;
  45. WriteLn(' 1 ');
  46. WriteLn(' ⌠ ');
  47. WriteLn(' │ 2 x dx = 1');
  48. WriteLn(' ⌡ ');
  49. WriteLn(' 0 ');
  50. WriteLn;
  51. WriteLn(' __');
  52. WriteLn('√ 2 = ', sqrt(2));
  53. WriteLn;
  54.  
  55. // thanks wp, https://f...content-available-to-author-only...l.org/index.php/topic,38910.msg265726.html#msg265726
  56. // Use Unicode range "Box Drawing" in Lazarus' character map
  57. WriteLn('┏━━┓ ┏━━┓');
  58. WriteLn('┛ ┗━━┛ ┗');
  59. WriteLn;
  60.  
  61. // Thanks Mr Bee aka @pak_lebah, from ansicrt.pas unit
  62. for i:= 1 to 10 do s:= s + tdHorzLine;
  63. WriteLn(tdTopLeft + s + tdTopRight);
  64.  
  65.  
  66. ReadLn;
  67. end.
Success #stdin #stdout 0s 4444KB
stdin
Standard input is empty
stdout
┌──────────────────────┐
│ Text in a box        │
╘══════════════════════╛

  ! " # $ % & ' ( ) * + , - . / 
0 1 2 3 4 5 6 7 8 9 : ; < = > ? 
@ A B C D E F G H I J K L M N O 
P Q R S T U V W X Y Z [ \ ] ^ _ 
` a b c d e f g h i j k l m n o 
p q r s t u v w x y z { | } ~  
� � � � � � � � � � � � � � � � 
� � � � � � � � � � � � � � � � 
� � � � � � � � � � � � � � � � 
� � � � � � � � � � � � � � � � 
� � � � � � � � � � � � � � � � 
� � � � � � � � � � � � � � � � 
� � � � � � � � � � � � � � � � 
� � � � � � � � � � � � � � � � 

 1           
 ⌠           
 │ 2 x dx = 1
 ⌡           
 0           

 __
√ 2 =  1.41421356237309504876E+0000

┏━━┓  ┏━━┓
┛  ┗━━┛  ┗

(0l(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0q(B(0k(B