Advertisement
Lord_agustin19

Tp codigo QR

Jul 30th, 2019
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.49 KB | None | 0 0
  1. program QRcode;
  2. uses crt;
  3.  
  4. const
  5.      cuad = 254;
  6.      rec = 219;
  7.  
  8. var
  9.    I,J:integer;
  10.    num:char;
  11.    kk:string;
  12.  
  13. procedure binario;
  14. begin
  15. case num of
  16. '0':kk:='0000';
  17. '1':kk:='0001';
  18. '2':kk:='0010';
  19. '3':kk:='0011';
  20. '4':kk:='0100';
  21. '5':kk:='0101';
  22. '6':kk:='0110';
  23. '7':kk:='0111';
  24. '8':kk:='1000';
  25. '9':kk:='1001';
  26. end;
  27. end;
  28.  
  29. procedure binary;
  30. begin
  31. case num of
  32. '0': write('*');
  33. '1': write('|');
  34. end;
  35. end;
  36.  
  37. procedure dibuja1;
  38. begin
  39. for I := 1 to 8 do
  40. begin
  41. gotoxy(I,1);
  42. textcolor(9);
  43. write(chr(cuad));
  44. gotoxy(I,8);
  45. write(chr(cuad));
  46. gotoxy(I,14);
  47. write(chr(cuad));
  48. gotoxy(I,21);
  49. write(chr(cuad));
  50. end;
  51. for I := 14 to 21 do
  52. begin
  53. gotoxy(I,1);
  54. write(chr(cuad));
  55. gotoxy(I,8);
  56. write(chr(cuad));
  57. end;
  58. for I := 9 to 13 do
  59. begin
  60. gotoxy(I,7);
  61. write(chr(cuad));
  62. end;
  63. end;
  64.  
  65. procedure dibuja2;
  66. begin
  67. for J := 1 to 8 do
  68. begin
  69. gotoxy(1,J);
  70. textcolor(9);
  71. write(chr(rec));
  72. gotoxy(8,J);
  73. write(chr(rec));
  74. gotoxy(14,J);
  75. write(chr(rec));
  76. gotoxy(21,J);
  77. write(chr(rec));
  78. end;
  79. for J := 14 to 21 do
  80. begin
  81. gotoxy(1,J);
  82. write(chr(rec));
  83. gotoxy(8,J);
  84. write(chr(rec));
  85. end;
  86. for J := 8 to 14 do
  87. begin
  88. gotoxy(7,J);
  89. write(chr(rec));
  90. end;
  91. end;
  92.  
  93. procedure partevar;
  94. begin
  95. Writeln('Ingrese cuatro numeros del 0 al 9');
  96. writeln();
  97. read(num);
  98. binario;
  99. end;
  100.  
  101. procedure grafico;
  102. begin
  103. for I := 18 to 21 do
  104. begin
  105. binary;
  106. textcolor(4);
  107. gotoxy(I,10);
  108. write(00);
  109. write(11);
  110. end;
  111. end;
  112.  
  113.  
  114. begin
  115. partevar;
  116. ClrScr;
  117. grafico;
  118. dibuja1;
  119. dibuja2;
  120. readkey
  121. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement