Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. 13 int ft_putchar(char c);
  2. 14
  3. 15 void print_first_line1(int h)
  4. 16 {
  5. 17 int i;
  6. 18
  7. 19 i = 0;
  8. 20 ft_putchar('/');
  9. 21 while (i < (h - 2))
  10. 22 {
  11. 23 ft_putchar('*');
  12. 24 i++;
  13. 25 }
  14. 26 if (h > 1)
  15. 27 ft_putchar('\\');
  16. 28 ft_putchar('\n');
  17. 29 }
  18. 30
  19. 31 void print_line1(int h)
  20. 32 {
  21. 33 int i;
  22. 34
  23. 35 i = 0;
  24. 36 ft_putchar('*');
  25. 37 while (i < (h - 2))
  26. 38 {
  27. 39 ft_putchar(' ');
  28. 40 i++;
  29. 41 }
  30. 42 if (h > 1)
  31. 43 ft_putchar('*');
  32. 44 ft_putchar('\n');
  33. 45 }
  34. 46
  35. 47 void print_last_line1(int h)
  36. 48 {
  37. 49 int i;
  38. 50
  39. 51 i = 0;
  40. 52 ft_putchar('\\');
  41. 53 while (i < (h - 2))
  42. 54 {
  43. 55 ft_putchar('*');
  44. 56 i++;
  45. 57 }
  46. 58 if (h > 1)
  47. 59 ft_putchar('/');
  48. 60 ft_putchar('\n');
  49. 61 }
  50. 62
  51. 63 void rush01a(int h, int v)
  52. 64 {
  53. 65 int i;
  54. 66
  55. 67 i = 0;
  56. 68 if (h < 1 || v < 1)
  57. 69 return ;
  58. 70 print_first_line1(h);
  59. 71 while (i < (v - 2))
  60. 72 {
  61. 73 print_line1(h);
  62. 74 i++;
  63. 75 }
  64. 76 if (v > 1)
  65. 77 print_last_line1(h);
  66. 78 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement