first commit
This commit is contained in:
18
finish/rush00/ex00/ft_putchar.c
Normal file
18
finish/rush00/ex00/ft_putchar.c
Normal file
@ -0,0 +1,18 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_putchar.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: ttrave <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/07/12 11:59:45 by ttrave #+# #+# */
|
||||
/* Updated: 2023/07/15 09:59:04 by ttrave ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
void ft_putchar(char c)
|
||||
{
|
||||
write(1, &c, 1);
|
||||
}
|
19
finish/rush00/ex00/main.c
Normal file
19
finish/rush00/ex00/main.c
Normal file
@ -0,0 +1,19 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* main.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: ttrave <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/07/15 10:00:20 by ttrave #+# #+# */
|
||||
/* Updated: 2023/07/15 10:39:38 by ttrave ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
void rush(int x, int y);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
rush(25, 17);
|
||||
return (0);
|
||||
}
|
41
finish/rush00/ex00/rush00.c
Normal file
41
finish/rush00/ex00/rush00.c
Normal file
@ -0,0 +1,41 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* rush00.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: ttrave <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/07/14 21:13:37 by ttrave #+# #+# */
|
||||
/* Updated: 2023/07/16 11:30:51 by ttrave ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
void ft_putchar(char c);
|
||||
|
||||
void rush(int x, int y)
|
||||
{
|
||||
int w;
|
||||
int h;
|
||||
|
||||
w = 1;
|
||||
h = 1;
|
||||
while (y > 0 && h <= y)
|
||||
{
|
||||
while (x > 0 && w <= x)
|
||||
{
|
||||
if (((h == 1 || h == y) && w == 1)
|
||||
|| ((h == 1 || h == y) && w == x))
|
||||
ft_putchar('o');
|
||||
else if (w == x || w == 1)
|
||||
ft_putchar('|');
|
||||
else if (h == 1 || h == y)
|
||||
ft_putchar('-');
|
||||
else
|
||||
ft_putchar(' ');
|
||||
w++;
|
||||
}
|
||||
ft_putchar('\n');
|
||||
w = 1;
|
||||
h++;
|
||||
}
|
||||
}
|
40
finish/rush00/ex00/rush01.c
Normal file
40
finish/rush00/ex00/rush01.c
Normal file
@ -0,0 +1,40 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* rush01.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: ttrave <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/07/14 21:13:37 by ttrave #+# #+# */
|
||||
/* Updated: 2023/07/16 11:31:22 by ttrave ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
void ft_putchar(char c);
|
||||
|
||||
void rush(int x, int y)
|
||||
{
|
||||
int w;
|
||||
int h;
|
||||
|
||||
w = 1;
|
||||
h = 1;
|
||||
while (y > 0 && h <= y)
|
||||
{
|
||||
while (x > 0 && w <= x)
|
||||
{
|
||||
if ((w == 1 && h == 1) || (w == x && h == y))
|
||||
ft_putchar('/');
|
||||
else if ((w == x && h == 1) || (w == 1 && h == y))
|
||||
ft_putchar('\\');
|
||||
else if (w == x || w == 1 || h == 1 || h == y)
|
||||
ft_putchar('*');
|
||||
else
|
||||
ft_putchar(' ');
|
||||
w++;
|
||||
}
|
||||
ft_putchar('\n');
|
||||
w = 1;
|
||||
h++;
|
||||
}
|
||||
}
|
40
finish/rush00/ex00/rush02.c
Normal file
40
finish/rush00/ex00/rush02.c
Normal file
@ -0,0 +1,40 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* rush02.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: ttrave <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/07/14 21:13:37 by ttrave #+# #+# */
|
||||
/* Updated: 2023/07/16 11:32:34 by ttrave ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
void ft_putchar(char c);
|
||||
|
||||
void rush(int x, int y)
|
||||
{
|
||||
int w;
|
||||
int h;
|
||||
|
||||
w = 1;
|
||||
h = 1;
|
||||
while (y > 0 && h <= y)
|
||||
{
|
||||
while (x > 0 && w <= x)
|
||||
{
|
||||
if (h == 1 && (w == 1 || w == x))
|
||||
ft_putchar('A');
|
||||
else if (h == y && (w == 1 || w == x))
|
||||
ft_putchar('C');
|
||||
else if (w == x || w == 1 || h == 1 || h == y)
|
||||
ft_putchar('B');
|
||||
else
|
||||
ft_putchar(' ');
|
||||
w++;
|
||||
}
|
||||
ft_putchar('\n');
|
||||
w = 1;
|
||||
h++;
|
||||
}
|
||||
}
|
40
finish/rush00/ex00/rush03.c
Normal file
40
finish/rush00/ex00/rush03.c
Normal file
@ -0,0 +1,40 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* rush03.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: ttrave <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/07/14 21:13:37 by ttrave #+# #+# */
|
||||
/* Updated: 2023/07/16 11:33:12 by ttrave ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
void ft_putchar(char c);
|
||||
|
||||
void rush(int x, int y)
|
||||
{
|
||||
int w;
|
||||
int h;
|
||||
|
||||
w = 1;
|
||||
h = 1;
|
||||
while (y > 0 && h <= y)
|
||||
{
|
||||
while (x > 0 && w <= x)
|
||||
{
|
||||
if (w == 1 && (h == 1 || h == y))
|
||||
ft_putchar('A');
|
||||
else if (w == x && (h == 1 || h == y))
|
||||
ft_putchar('C');
|
||||
else if (w == x || w == 1 || h == 1 || h == y)
|
||||
ft_putchar('B');
|
||||
else
|
||||
ft_putchar(' ');
|
||||
w++;
|
||||
}
|
||||
ft_putchar('\n');
|
||||
w = 1;
|
||||
h++;
|
||||
}
|
||||
}
|
40
finish/rush00/ex00/rush04.c
Normal file
40
finish/rush00/ex00/rush04.c
Normal file
@ -0,0 +1,40 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* rush04.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: ttrave <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/07/14 21:13:37 by ttrave #+# #+# */
|
||||
/* Updated: 2023/07/16 11:33:48 by ttrave ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
void ft_putchar(char c);
|
||||
|
||||
void rush(int x, int y)
|
||||
{
|
||||
int w;
|
||||
int h;
|
||||
|
||||
w = 1;
|
||||
h = 1;
|
||||
while (y > 0 && h <= y)
|
||||
{
|
||||
while (x > 0 && w <= x)
|
||||
{
|
||||
if ((w == 1 && h == 1) || (w == x && h == y))
|
||||
ft_putchar('A');
|
||||
else if ((w == x && h == 1) || (w == 1 && h == y))
|
||||
ft_putchar('C');
|
||||
else if (w == x || w == 1 || h == 1 || h == y)
|
||||
ft_putchar('B');
|
||||
else
|
||||
ft_putchar(' ');
|
||||
w++;
|
||||
}
|
||||
ft_putchar('\n');
|
||||
w = 1;
|
||||
h++;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user