1
0

first commit

This commit is contained in:
Adam Joly
2023-08-03 23:16:27 +02:00
parent 7f3254f1c5
commit a80c4d61d7
133 changed files with 4293 additions and 0 deletions

View File

@ -0,0 +1,78 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* write.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/07/31 23:11:14 by axdubois #+# #+# */
/* Updated: 2023/08/02 20:34:57 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "../../includes/Display-h/write.h"
#include "../../includes/utils-h/utils.h"
#include "../../includes/algo-h/algo.h"
#include "../../includes/utils-h/charobj.h"
#include "../../includes/utils-h/fst_line.h"
#include "../../includes/utils-h/utils.h"
void ft_putchar(char c)
{
write(1, &c, 1);
}
void ft_print(char *str)
{
int i;
i = 0;
while (str[i])
{
ft_putchar(str[i]);
i++;
}
}
void ft_print_linesq(int side,char x)
{
int i;
i = 0;
while(i < side)
{
ft_putchar(x);
i++;
}
}
void ft_print_result(t_square sq,t_charobj c,t_coords *listobj,int file)
{
int x;
int y;
int ysq;
y = 1;
ysq = 0;
while (y < ft_len_colum(file))
{
x = 0;
while (x < ft_len_line(file, y))
{
if ((listobj[x].x == x) && (listobj[y].y == y))
ft_putchar(c.o);
else if ((sq.x == x) && (ysq < sq.side))
{
ft_print_linesq(sq.side,c.x);
x += sq.side -1;
ysq++;
}
else
ft_putchar(c.n);
x++;
}
ft_putchar('\n');
y++;
}
}

BIN
BSQ/srcs/Display-c/write.o Normal file

Binary file not shown.