This commit is contained in:
Camille Chauvet
2023-05-17 16:45:25 +00:00
commit 29ed24d567
619 changed files with 16119 additions and 0 deletions

BIN
Rush/Rush00/ex00/a.out Executable file

Binary file not shown.

View File

@ -0,0 +1,20 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putchar.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mchedota <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/15 18:08:06 by mchedota #+# #+# */
/* Updated: 2022/07/16 09:56:02 by mchedota ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
void ft_putchar(char c);
void ft_putchar(char c)
{
write(1, &c, 1);
}

21
Rush/Rush00/ex00/main.c Normal file
View File

@ -0,0 +1,21 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mchedota <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/15 18:17:20 by mchedota #+# #+# */
/* Updated: 2022/07/19 15:00:38 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
void rush(int x, int y);
int main(void)
{
rush(0, 0);
return (0);
}

41
Rush/Rush00/ex00/rush02.c Normal file
View File

@ -0,0 +1,41 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* rush02.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mchedota <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/15 18:18:02 by mchedota #+# #+# */
/* Updated: 2022/07/16 10:02:11 by mchedota ### ########.fr */
/* */
/* ************************************************************************** */
void ft_putchar(char c);
void rush(int x, int y)
{
int flag_x;
int flag_y;
int test_x;
flag_y = 1;
while (y >= flag_y)
{
flag_x = 1;
while (x >= flag_x)
{
test_x = flag_x == 1 || flag_x == x;
if (test_x && flag_y == 1)
ft_putchar('A');
else if (test_x && flag_y == y)
ft_putchar('C');
else if (test_x || (flag_y == 1 || flag_y == y))
ft_putchar('B');
else
ft_putchar(' ');
flag_x++;
}
ft_putchar('\n');
flag_y++;
}
}