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,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
View 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);
}

View 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++;
}
}

View 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++;
}
}

View 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++;
}
}

View 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++;
}
}

View 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++;
}
}