Advertisement
RyoMaeda

My .h File

Nov 22nd, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. #ifndef _RYO_H_
  2. #define _RYO_H_
  3.  
  4.  
  5. #include <iostream>
  6. #include <windows.h>
  7. #include <stdlib.h>
  8. #include <time.h>
  9. #include <conio.h>
  10. #include <sstream>
  11. #include <fstream>
  12.  
  13. using namespace std;
  14. void gotoxy(short x, short y) {
  15. COORD pos = {x, y};
  16. SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
  17. }
  18.  
  19.  
  20.  
  21.  
  22. void drawbox(int x, int y,int width, int height, char sym);
  23. //This makes a filled box
  24. void drawbox(int x, int y,int width, int height, char sym)
  25. {
  26. for(int j=0;j<width;j++)
  27. {
  28. for(int i=0;i<height;i++)
  29. {
  30. gotoxy(x+j,y+i);
  31. cout<<sym;
  32. }
  33. }
  34. }
  35.  
  36. void framedbox(int xcoord, int ycoord, int width, int height, char symbol);
  37. //This makes a framed box
  38. void framedbox(int xcoord, int ycoord, int width, int height, char symbol)
  39. {
  40. for(int zz = 0; zz<height; zz++)
  41. {
  42. for(int aa = 0; aa<width; aa++)
  43. {
  44. gotoxy(zz +xcoord, ycoord +aa);
  45. cout<<symbol;
  46. }
  47. }
  48. for(int ff = 1; ff<height-1; ff++)
  49. {
  50. for(int ss = 1; ss<width-1; ss++)
  51. {
  52. gotoxy(xcoord +ff, ycoord +ss);
  53. cout<<' ';
  54. }
  55. }
  56. }
  57.  
  58. void drawline(int length, int xcoord, int ycoord, char sym);
  59. //This makes a line
  60. void drawline(int length, int xcoord, int ycoord, char sym)
  61. {
  62. for(int aa = 0; aa<length; aa++)
  63. {
  64. gotoxy(xcoord +aa, ycoord);
  65. cout<<sym;
  66. }
  67. }
  68. void makebox(int width, int height,int x, int y, char sym);
  69. //This makes a filled box
  70. void makebox(int width, int height,int x, int y, char sym)
  71. {
  72. for(int j=0;j<width;j++)
  73. {
  74. for(int i=0;i<height;i++)
  75. {
  76. gotoxy(x+j,y+i);
  77. cout<<sym;
  78. }
  79. }
  80. }
  81.  
  82. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement