Advertisement
Jvsierra

adafasf

Sep 10th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio2.h>
  3. #include <stdlib.h>
  4. #include <windows.h>
  5.  
  6. void QuadroDup(int CI, int LI, int CF, int LF, int CorT, int corF)
  7. {
  8. int i;
  9.  
  10. textcolor(CorT); textbackground(corF);
  11.  
  12. gotoxy(CI, LI);
  13. printf("%c", 201);
  14.  
  15. gotoxy(CI, LF);
  16. printf("%c", 200);
  17.  
  18. gotoxy(CF, LI);
  19. printf("%c", 187);
  20.  
  21. gotoxy(CF, LF);
  22.  
  23. printf("%c", 188);
  24.  
  25. for(i = CI+1; i < CF; i++)
  26. {
  27. gotoxy(i, LI);
  28. printf("%c", 205);
  29. }
  30.  
  31. for(i = LI + 1; i < LF; i++)
  32. {
  33. gotoxy(CI, i);
  34. printf("%c", 186);
  35. gotoxy(CF, i);
  36. printf("%c", 186);
  37. }
  38.  
  39. for(i = CI + 1; i < CF; i++)
  40. {
  41. gotoxy(i, LF);
  42. printf("%c", 205);
  43. }
  44. }
  45.  
  46. void ASCII(void)
  47. {
  48. int i = 0, col = 2, lin = 2, cor = 1;
  49.  
  50. clrscr();
  51.  
  52. /*
  53. for(coluna = 1; coluna <= 80; coluna+=7)
  54. {
  55. for(linha = 1; linha <= 25 && i < 256; linha++)
  56. {
  57. gotoxy(coluna, linha);
  58. printf("%d - %c", i, i++);
  59. }
  60. }
  61. */
  62.  
  63. for(i = 0; i < 256; i++)
  64. {
  65. textcolor(cor);
  66. cor++;
  67.  
  68. gotoxy(col, lin);
  69. printf("%d - %c", i, i);
  70.  
  71. if(cor == 15)
  72. cor = 1;
  73.  
  74. if(lin == 24)
  75. {
  76. lin = 2;
  77. col += 8;
  78. }
  79. else
  80. lin++;
  81. }
  82.  
  83. QuadroDup(5,3, 75,23, 1, 2);
  84.  
  85.  
  86. getch();
  87. }
  88.  
  89.  
  90. int main(void)
  91. {
  92. QuadroDup(5,3, 75,23, 1, 2);
  93.  
  94. return 1;
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement