Improved rush function

This commit is contained in:
Juan Bosco Torrez Castillo 2023-03-18 19:49:02 +01:00
parent d902e5d22b
commit ca46c9f95e
1 changed files with 6 additions and 7 deletions

View File

@ -6,7 +6,7 @@
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/18 02:10:24 by tischmid #+# #+# */
/* Updated: 2023/03/18 05:01:27 by tischmid ### ########.fr */
/* Updated: 2023/03/18 19:48:04 by jtorrez- ### ########.fr */
/* */
/* ************************************************************************** */
@ -46,7 +46,8 @@ void rush(int x, int y)
int i;
i = 0;
if (y)
if (x == 0 || y == 0)
return ;
horiz_line(g_corners[0], g_horizontal, g_corners[1], x);
while (i++ < y - 2)
horiz_line(g_vertical, g_inside, g_vertical, x);
@ -59,12 +60,10 @@ void horiz_line(char left, char middle, char right, int width)
int i;
i = 0;
if (width)
ft_putchar(left);
while (i++ < width - 2)
ft_putchar(middle);
if (width > 1)
ft_putchar(right);
if (width)
ft_putchar('\n');
}