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